Ask the fastcgi cache expiration time in nginx and how to clear the cache

Source: Internet
Author: User
First of all, question 1: nginx cache expiration time I set 300 seconds in conf to expire, but after I updated the blog log page 300 seconds, the page is not updated, as shown in: my friends are stunned! Implement the levi. cg. amarchives3066 text editor with 10 lines of JavaScript...

First, question 1: nginx cache expiration time
I set 300 seconds to expire in conf, but after I updated the blog log page 300 seconds, the page is refreshed and not updated.

For example:
My friends are stunned! Text Editor with 10 lines of JavaScript
Http://levi.cg.am/archives/3066


Why?

Question 2: How to clear the cache
I found that nginx stores the cache in the specified directory and sets the directory with the last four digits of the cached file name. For example:

I think the cache name should be MD5. If the cached file is deleted, the cache of the specified page will be deleted successfully.
But this MD5 does not seem to be determined based on the URL, or the above link, input in PHP:

echo md5('http://levi.cg.am/archives/3066');// output 4099cbf6f33f521b84cdb94d707f5758

It seems that there is no 4099cbf6f33f521b84cdb94d707f5758 file.

I read the fastcgi cache key set in conf.

fastcgi_cache_key $request_method://$host$request_uri;

It should be a domain name. Is it true that the md5 in nginx is inconsistent with that in php? How can I know the cached files on the specified page?

Reply content:

First, question 1: nginx cache expiration time
I set 300 seconds to expire in conf, but after I updated the blog log page 300 seconds, the page is refreshed and not updated.

For example:
My friends are stunned! Text Editor with 10 lines of JavaScript
Http://levi.cg.am/archives/3066


Why?

Question 2: How to clear the cache
I found that nginx stores the cache in the specified directory and sets the directory with the last four digits of the cached file name. For example:

I think the cache name should be MD5. If the cached file is deleted, the cache of the specified page will be deleted successfully.
But this MD5 does not seem to be determined based on the URL, or the above link, input in PHP:

echo md5('http://levi.cg.am/archives/3066');// output 4099cbf6f33f521b84cdb94d707f5758

It seems that there is no 4099cbf6f33f521b84cdb94d707f5758 file.

I read the fastcgi cache key set in conf.

fastcgi_cache_key $request_method://$host$request_uri;

It should be a domain name. Is it true that the md5 in nginx is inconsistent with that in php? How can I know the cached files on the specified page?

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.