The following headers seem to be recommended using when outputing JSON:
header('Cache-Control: no-cache, must-revalidate');
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Content-type: application/json');
What is the purpose of the Expires header when Cache-control is set to no-cache, must-revalidate?
This resolves some browser and caching proxies issues.
It seems like there are some of these that do not understand some headers and/or are configured not to, so it is just a workaround trying to be compatible with a little more of the end users' browser and caching proxies in the middle.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With