Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Per default the data loaded from the server (JSON or XML data) <strong>will be saved in the browser cache, but not used</strong> at the next request. The reason is that per default jqGrid implement the same behavior of ajax requests like <code>cache:false</code> parameter of <a href="http://api.jquery.com/jQuery.ajax/" rel="nofollow">jQuery.ajax</a>. It means that all requests has an additional parameter <code>nd</code> like <code>nd=1286296925096</code> which is the timestamp. It makes the URL of all GET requests unique and so the local saved data will not used twice. So <strong>if you want that jqGrid not use the data from the local browser cache you need to do nothing</strong>.</p> <p>If you want additionally deny saving the data locally (for example because of security reason or to reduce filling of the local cache with the information which will never used) you can include <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.2" rel="nofollow">no-store</a> directive in the HTTP header of the server response.</p> <p>If you do want to cache the server requests and use the data you should <code>prmNames: { nd:null}</code> <a href="http://www.trirand.com/jqgridwiki/doku.php?id=wiki%3aoptions" rel="nofollow">jqGrid option</a>. Then the data from the next requests could be get from the local browser cache. If you do this I'll recommend you include in the HTTP header of the server response the <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html" rel="nofollow">Cache-Control</a> directives which force to use the caching behavior which you need. For example I use personally <code>Cache-Control: max-age=0</code> and use <code>ETag</code> with the hash from the data sent. So all ajax requests <strong>will be sent</strong> to the server to <strong>revalidate</strong> the local cache. All the requests will be automatically contain <code>If-None-Match</code> HTTP header with the <code>ETag</code> of the data from the local cache. If the data are not changed the server can answer with the response <code>HTTP/1.1 304 Not Modified</code> having no body instead of <code>HTTP/1.1 200 OK</code> with the body having the data. The response <code>HTTP/1.1 304 Not Modified</code> allows the browser to use the local cache.</p> <p><strong>UPDATED:</strong> I use additionally <code>Cache-Control: private</code> which switch off caching the data on the proxy and declare that the data could be cached, but not shared with another users.</p> <p>If you want read more about caching control with respect of HTTP headers I'll recommend you to read the following <a href="http://www.mnot.net/cache_docs/" rel="nofollow">Caching Tutorial</a>.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload