This is the case: we have a domain name on the CDN, it is to cache some of the IMG and JS and other static resources. But because of the business needs, we have added a dynamic PHP file to interface to accept some user feedback content.
And then today in this interface on the online a little bit of a problem I'm going to debug found, I changed the code after the refresh did not work, but my link change parameters on the code will work, I suspect that the link was cached by the CDN, but Ops told me that CDN does not cache dynamic files. Then I went to test to see the Nginx Log Refresh page does not have access to the log.
Finally, the operation of the link to the CDN vendor analysis, is indeed a cache. CDN over there configured to follow the policy of the source station, by default, we do not set PHP files do not cache, we have cached for 24 hours
We need to add a header to the Nginx configuration file location When we configure PHP not to cache.
//配置PHP不缓存.*\.(php|php5)?$ { Cache-Control no-cache; }//配置缓存2分钟location ~* ^.+\.(js|css)$ { 120s; }
'). addclass (' pre-numbering '). Hide (); $ (this). addclass (' has-numbering '). Parent (). append ($numbering); for (i = 1; i <= lines; i++) {$numbering. Append ($ ('
'). Text (i)); }; $numbering. FadeIn (1700); }); });
The above is introduced to do not let CDN cache your dynamic files, including aspects of the content, I hope to be interested in PHP tutorial friends helpful.