Mobile Web Debugging • How to clear the browser cache

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.