I am on a Linux shared hosting server. It has been a problem since day one that my code updates don't get reflected. The browser keeps rendering the result from the code that has been updated. I tried to clean the cache but it didn't help. Also, I tried to run the code from Edge, Chrome, and Firefox. Only Firefox recognized part of the updates but Edge and Chrome would totally ignore them. I had the same problem while running on localhost. I either had to wait for a period of time for the old code to be flushed or keeping flipping file names. It looks to me the old codes don't get flushed out right away. Anyone else has the same experience?
Asked
Active
Viewed 70 times
0
-
Does this answer your question? [Setup HTTP expires headers using PHP and Apache](https://stackoverflow.com/questions/1036941/setup-http-expires-headers-using-php-and-apache) – Iłya Bursov Jul 29 '22 at 22:00
2 Answers
0
Well, provided you are using NGINX as the web server of choice, it is possible to modify the way code updates are applied, here is a configuration that will apply any code updates you make instantly no matter what:
server {
# OTHER CONFIG
add_header Last-Modified $date_gmt;
add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
if_modified_since off;
expires off;
etag off;
# OTHER CONFIG
}
If NGINX is not the server you're using and you'd like to learn more about it, I'd recommend going to https://landchad.net It's a great website that describes how to set up an NGINX instance in a very beginner-friendly way.

zer0flag
- 35
- 1
- 5
0
I have this issue with Chrome and Firefox this sounds like a browser cache issue... I have to keep clearing my browser history data to force the new data to appear.

John Dohh
- 37
- 7
-
Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Aug 01 '22 at 19:40