When debugging Web pages in your phone, always worry about clearing the cache. Especially the QQ browser. Finally, some students have developed the Android Next button to clear the various browser cache app, but requires root, and each time is not short. Finally, a convenient and effective method is found. That is, the HTTP response header is used to force the browser not to cache resources.
how to implement in NodeJS :
You can set the response header in Nodejs by setting the method
Res.setheader ("CacheControl", ' No-cache '); Res.setheader ("Expires",-1);
Apache Configuration method:
Open the Mod_headers.so module in the Apache configuration file
Apache configuration path under Mac in /etc/apache2/httpd.conf
Find this line and get rid of the previous pound sign.
LoadModule Expires_module libexec/apache2/mod_headers.so
Under Site configuration, add the following:
Header set Cache-control "No-cache"
Header set Expires "-1"
The final example is as follows:
< virtualhost *:80 > DocumentRoot "/users/tick/ Projects/local "ServerName localhost header set Cache-control" No-cache " header set Expi Res "-1" < directory "/users/tick/local" > Options Indexes followsymlinks allowoverride all Order Allow,deny Allow from all </ directory Span style= "color: #0000ff;" >> </ virtualhost >
Nginx Configuration method:
Todo...
Mobile Web Debugging • How to clear the browser cache