This might be a stupid question, but I searched a lot without any result. I know how to setup cache-control in server responses, but how can I change the cache control value
You can use headers
property, like this:
$.ajax({
...
headers: {
'Cache-Control': 'max-age=1000'
}
...
});
Keep in mind that cache
property has nothing in common with Cache-Control
header, it's just a cache buster (appending ?_={timestamp}
to GET parameters) and will only work correctly with GET
and HEAD
requests.
Anyway, something useful: How to set HTTP headers (for cache-control)?