I am trying to serve a PHP file output with HTTP Headers configured so the content will NOT be served from cache in Chrome.
If I go to Dev tools (in Chrome), and mark the "Disable cache" option, then it works.
But I don't want to depend on that, I hope I can setup HTTP headers in a way I can force Chrome to reload the page everytime.
Here's a screenshot of my current attempt, please note the red marks.
Could you please provide good documentation or which headers I must declare for this ?
Thanks in advance.
So I found this other reply too: Chrome caching like a mad browser, but since I recall being told that Chrome needs special headers for Cache-Control
, I will keep this question.
When you're in Google Chrome, click on View, then select Developer, then Developer Tools. Alternatively, you can right click on a page in Chrome, then click Inspect. Click on the Network tab, then check the box to Disable cache.
Here are some ways you can try to fix your caching problem, in order of escalation: Try holding down the Shift key while pressing the Refresh button. Close your browser and re-open it (make sure you are NOT on the cached page) and delete your temporary Internet files (clear your cache).
Without the cache control header the browser requests the resource every time it loads a new(?) page.
To use cache-control in HTML, you use the meta tag, e.g. The value in the content field is defined as one of the four values below. HTTP 1.1. Allowed values = PUBLIC | PRIVATE | NO-CACHE | NO-STORE.
Web browsers can cache AJAX requests with the same request parameters. In order to work around this problem, use a query string that changes. One example would be to use the date in seconds as a query parameter.
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