Avoid caching in websites (cache busting)
Caching occurs in many places in a modern website.
Generally during production this is great but in development
its a pain.
Add ?time a the end of a URL in your browser's address bar
Only identical URLs are cached. Adding the time
(Of course update the time as it ticks along) will make different
URLs so they won't be cached.
Well, not exactly - it only stops the main page from being cached.
may be cached.
2. Apache no-cache directive
This directive tells Apache not to cache anything
Header unset ETag
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"
It uses every direction known to man to stop caching.
I think `Header set Pragma "no-cache"` is probably enough but its easy to use them all.
Please note: I do NOT recommend this for production sine it will slow
performance. Generally caching is useful.
After you have added this directive, reload Apache:
systemctl reload httpd
Again, remove the directive for production.
When doing a MySQL SELECT you can throw in SQL_NO_CACHE to avoid
SELECT SQL_NO_CACHE id, name FROM customer;