Score:1

Clear cache on nginx server

eg flag

I have a server, when I'm developing a website on my local machine I want to upload it to test it on the production server, however I'm facing a problem from the mobile phone I still get the old version of the server, on the PC I can do a hard refresh however on mobile phone I keep wait until the website refresh is there any solution for this problem? can I clear cache on the server or any other solution?

il flag
nginx doesn't cache things by default, but web browsers do.
Buildermine avatar
eg flag
@jordanm so what can i do to the mobile browser to fix that? for example Google Chrome on iPhone 13 pro max?
Paul avatar
cn flag
You could try setting `Cache-Control: no-cache`. I've don't have experience experimenting with it.
djdomi avatar
za flag
@community the question ia clearly, it a bit boxed inside, but if you're reading between the lines you understand that he asks for, bow to disable the nginx cache functions
Score:1
za flag

for nginx it would be easy

include this in server or location

proxy_cache_bypass                      $http_upgrade;
proxy_no_cache                          1;
proxy_cache_bypass                      1;
proxy_redirect                          off;
proxy_cache                             off;
add_header                      'Cache-Control' 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
 expires -1;

i used /etc/nginx/nocache.conf with the above content and just using include nocache.conf

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.