This article is a mirror article of machine translation, please click here to jump to the original article.

View: 14131|Reply: 0

[CDN] If the cache-control of the page header is set to no-cache, will the access be to the back server through the CDN?

[Copy link]
Posted on 11/2/2014 1:41:21 PM | | | |
This estimate depends on the CDN settings of different service providers, and the following are the Nginx caching policy settings of Alibaba Cloud's CDN

HTTP Headers, which allows arbitrary HTTP headers to be set

1) add_header
Syntax: add_header name value
Default: none
Use the following fields: http, server, location

2) expires
Syntax: expires [time|epoch|max|off]
Default: expires off
Use the following fields: http, server, location

This directive controls whether an expiration time is marked in the response, and if so, how.
off will prohibit modification of the Expires and Cache-Control fields in the header.
Time controls the value of "Cache-Control", and negative numbers indicate no-cache
epoch set the Expires header to 1 January, 1970 00:00:01 GMT.
max set the Expires header to 31 December 2037 23:59:59 GMT, maxing out Cache-Control to 10 years.

For example, set the file type expiration time of PHP to 1 hour:




   


Set the file type of php to no-cache to prevent cache server from caching:






In addition, you can set the corresponding caching policy through add_header, and set it to no cache for dynamic PHP files:
  1. location ~ .*\.php$ {
  2.     if ($request_uri !~ ^/dynamicimg/) {
  3.         add_header              Cache-Control "no-cache";
  4.         add_header              Pragma no-cache;
  5.     }
  6.   }
Copy code







Previous:How to read the real or false iPhone 5s mobile phone? Apple iPhone 5s authenticity and fake identification tutorial
Next:Using the CDN service, Apache cache policy settings
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com