Adding this extra mystery query arg has always freaked me out.  Backends 
that don't know to ignore it will get confused...  At the very least, we 
need to document this behavior so developer don't get confused also!

-Max

[EMAIL PROTECTED] wrote:
> Author: hqm
> Date: 2006-09-12 20:07:10 -0700 (Tue, 12 Sep 2006)
> New Revision: 1825
> 
> Added:
>    openlaszlo/branches/legals/test/lfc/data/httpsequence.jsp
>    openlaszlo/branches/legals/test/lfc/data/testclientcachebreaker.lzx
> Modified:
>    openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzHTTPDatasource.lzs
>    openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/dhtml/LzHTTPLoader.js
>    openlaszlo/branches/legals/test/lfc/data/alldata.lzx
>    openlaszlo/branches/legals/test/lfc/data/testsetheaders.lzx
> Log:
> Change change.LscKi6240.txt by [EMAIL PROTECTED] 
> /home/hqm/src/svn/openlaszlo/branches/legals/WEB-INF/lps/lfc/ on 2006-09-12 
> 23:02:57 EDT
> 
> Summary: add cache breaking query arg to SOLO requests
> 
> New Features:
> 
> Bugs Fixed: LPPP-2677
> 
> Technical Reviewer: (pending)
> QA Reviewer: (pending)
> Doc Reviewer: (pending)
> 
> Documentation:
> 
> Release Notes:
> 
> Details:
> 
> The cache breaking query arg was only being added to proxied requests
>     
> 
> Tests:
> 
> test/lfc/data/alldata.lzx
> 
> 
> 
> 
> Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzHTTPDatasource.lzs
> ===================================================================
> --- openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzHTTPDatasource.lzs      
> 2006-09-12 22:42:41 UTC (rev 1824)
> +++ openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzHTTPDatasource.lzs      
> 2006-09-13 03:07:10 UTC (rev 1825)
> @@ -101,7 +101,17 @@
>  
>      if (proxied) {
>          url = tloader.makeProxiedURL(url, this.reqtype);
> -    } 
> +    }  else {
> +        // break the browser cache by creating an arg with a unique value
> +        if (!forset.clientcacheable) {
> +            var cachebreak = "__lzbc__="+(new Date()).getTime();
> +            if (url.indexOf('?') >= 0) {
> +                url = url + "&" + cachebreak;
> +            } else {
> +                url = url + "?" + cachebreak;
> +            }
> +        }
> +    }
>     
>      // [todo hqm 09-2006] For proxied requests, should the HTTP method
>      // (GET/POST) of the client->server HTTP method match the
> @@ -140,6 +150,11 @@
>      forset.rawtext = d.rawtext;
>      var proxied = this.isProxied(forset);
>  
> +    if (d == null) {
> +        forset.gotError("client could not parse XML from server");
> +        return;
> +    }
> +
>      if (d.childNodes[0].nodeName == "error") {
>          forset.gotError(d.childNodes[0].attributes['msg']);
>          return;
> 
> Modified: 
> openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/dhtml/LzHTTPLoader.js
> ===================================================================
> --- openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/dhtml/LzHTTPLoader.js   
> 2006-09-12 22:42:41 UTC (rev 1824)
> +++ openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/dhtml/LzHTTPLoader.js   
> 2006-09-13 03:07:10 UTC (rev 1825)
> @@ -230,24 +230,29 @@
>                  // only if "OK"
>                  if (__pthis__.req.status == 200 || __pthis__.req.status == 
> 304) {
>                      var elt = null;
> -                    var nodes = __pthis__.req.responseXML.childNodes;
> -                    //Debug.write('onreadystatechange resposnexml=',  
> __pthis__.req.responseXML);
> -                    //Debug.info('LzDataset.childNodes', 
> __pthis__.req.responseXML.nodeName, __pthis__.type);
> -                    // find first content (type == 1) child node
> -                    for (var i = 0; i < nodes.length; i++) {
> -                        var child = nodes.item(i);
> -                        if (child.nodeType == 1) {
> -                            elt = child;
> -                            break;
> +                    var xml = __pthis__.req.responseXML;
> +                    var lzxdata = null;
> +                    if (xml != null) {
> +                        var nodes = __pthis__.req.responseXML.childNodes;
> +                        // find first content (type == 1) child node
> +                        for (var i = 0; i < nodes.length; i++) {
> +                            var child = nodes.item(i);
> +                            if (child.nodeType == 1) {
> +                                elt = child;
> +                                break;
> +                            }
>                          }
> -                    }
> -                    __pthis__.removeTimeout(__pthis__);
> -                    var d = LzXMLTranslator.copyXML(elt,
> +                        lzxdata = LzXMLTranslator.copyXML(elt,
>                                                      
> __pthis__.options.trimwhitespace,
>                                                      
> __pthis__.options.nsprefix);
> +                    }
> +
>                      __pthis__.responseText = __pthis__.req.responseText;
> -                    //Debug.write('onreadystatechange 
> responseText=',__pthis__.req.responseText);
> +                    __pthis__.removeTimeout(__pthis__);
>  
> +                    Debug.write('onreadystatechange responseXML=',xml);
> +                    Debug.write('onreadystatechange 
> responseText=',__pthis__.req.responseText);
> +
>                      /**** DEBUGGING 
>                      var xmlSerializer = new XMLSerializer();
>                      var markup = xmlSerializer.serializeToString(elt);
> @@ -255,7 +260,7 @@
>                       *** /DEBUGGING
>                       */
>  
> -                    __pthis__.loadSuccess(__pthis__, d);
> +                    __pthis__.loadSuccess(__pthis__, lzxdata);
>                  } else {
>                      __pthis__.loadError(__pthis__, null);
>                  }
> 
> Modified: openlaszlo/branches/legals/test/lfc/data/alldata.lzx
> ===================================================================
> --- openlaszlo/branches/legals/test/lfc/data/alldata.lzx      2006-09-12 
> 22:42:41 UTC (rev 1824)
> +++ openlaszlo/branches/legals/test/lfc/data/alldata.lzx      2006-09-13 
> 03:07:10 UTC (rev 1825)
> @@ -18,6 +18,7 @@
>      <include href="testrawpost.lzx"/>
>      <include href="testrawpost-solo.lzx"/>
>      <include href="testheaderresponse.lzx"/>
> +    <include href="testclientcachebreaker.lzx"/>
>  
>      <TestSuite>
>          <TestDatanode/>
> @@ -35,6 +36,7 @@
>          <TestRawPost/>
>          <TestRawPostSOLO/>
>          <TestResponseHeaders/>
> +        <TestClientCacheBreaker/>
>      </TestSuite>
>  </canvas>
>  <!-- * X_LZ_COPYRIGHT_BEGIN 
> ***************************************************
> 
> Added: openlaszlo/branches/legals/test/lfc/data/httpsequence.jsp
> 
> 
> Property changes on: openlaszlo/branches/legals/test/lfc/data/httpsequence.jsp
> ___________________________________________________________________
> Name: svn:mime-type
>    + text/plain
> Name: svn:eol-style
>    + native
> 
> Added: openlaszlo/branches/legals/test/lfc/data/testclientcachebreaker.lzx
> 
> 
> Property changes on: 
> openlaszlo/branches/legals/test/lfc/data/testclientcachebreaker.lzx
> ___________________________________________________________________
> Name: svn:mime-type
>    + text/plain
> Name: svn:eol-style
>    + native
> 
> Modified: openlaszlo/branches/legals/test/lfc/data/testsetheaders.lzx
> ===================================================================
> --- openlaszlo/branches/legals/test/lfc/data/testsetheaders.lzx       
> 2006-09-12 22:42:41 UTC (rev 1824)
> +++ openlaszlo/branches/legals/test/lfc/data/testsetheaders.lzx       
> 2006-09-13 03:07:10 UTC (rev 1825)
> @@ -9,9 +9,13 @@
>      <attribute name="waitcnt" value="0"/>
>  
>      <datapointer xpath="edata:/echo" name="dp" 
> -                 oninit="parent.sendit()"
> -                 ondata="parent.dpready = true"/>
> +                 oninit="parent.sendit()" />
>  
> +    <handler reference="edata" name="ondata">
> +       Debug.write('testcase got edata ondata');
> +       this.dpready = true;
> +    </handler>
> +
>      <method name="sendit">
>        edata.setHeader("content-type", "application/xml");
>        edata.setQueryType("POST");
> 
> 
> _______________________________________________
> Laszlo-checkins mailing list
> [EMAIL PROTECTED]
> http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins

_______________________________________________
Laszlo-dev mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-dev

Reply via email to