I am loading some json through apache according to:


The JSON however is outdated after i make use of the apache url. The node.js :8000 url serves the right data.

How do i make certain apache does not cache json?


You are able to append a "cache killer" around the URL you're fetching asynchronously. That's some value that can certainly make the URL unique.

var url = "http://example.com/service.json?" + new Date().getTime();

A potential solution is always to setup the expire headers towards the past and make certain the browser doesn't cache nay json via cache-control haders for json files and You can test to include this for your apache config file :

<FilesMatch "\.(json|json)$">
     Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
     Header set Pragma "no-cache"
     Header set Expires "Thu, 01 Jan 1970 00:00:00 GMT"

The mod_headers module will have to be set up in Apache to make use of this process.

If you're interested you'll have a read in the roots