Does jqGrid store grid data on the file system? If so, do you need to clear the browser’s cache to remove it?
Or is it just stored in memory by JavaScript (and the browser)? Would just closing your browser remove the data?
Do the answers to these questions change depending on whether you are using loadOnce?
Per default the data loaded from the server (JSON or XML data) will be saved in the browser cache, but not used at the next request. The reason is that per default jqGrid implement the same behavior of ajax requests like
cache:falseparameter of jQuery.ajax. It means that all requests has an additional parameterndlikend=1286296925096which is the timestamp. It makes the URL of all GET requests unique and so the local saved data will not used twice. So if you want that jqGrid not use the data from the local browser cache you need to do nothing.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 no-store directive in the HTTP header of the server response.
If you do want to cache the server requests and use the data you should
prmNames: { nd:null}jqGrid option. 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 Cache-Control directives which force to use the caching behavior which you need. For example I use personallyCache-Control: max-age=0and useETagwith the hash from the data sent. So all ajax requests will be sent to the server to revalidate the local cache. All the requests will be automatically containIf-None-MatchHTTP header with theETagof the data from the local cache. If the data are not changed the server can answer with the responseHTTP/1.1 304 Not Modifiedhaving no body instead ofHTTP/1.1 200 OKwith the body having the data. The responseHTTP/1.1 304 Not Modifiedallows the browser to use the local cache.UPDATED: I use additionally
Cache-Control: privatewhich switch off caching the data on the proxy and declare that the data could be cached, but not shared with another users.If you want read more about caching control with respect of HTTP headers I’ll recommend you to read the following Caching Tutorial.