How do I change Fastcgi Cache duration?


I have a question regarding a Fastcgi cache.

I’ve created a wordpress site with a fastcgi cache using just this code:

ee site create --wpfc

I didn’t do any other configuration and Fastcgi Cache seems to be working. But it’s working for just a short period of time. I can see “HIT” in the header only after reloading a page, until then it’s usually “MISS”. And most importantly cache doesn’t last for long. It says “HIT” but it lasts for less than an hour and then cache becomes “Expired” or “MISS” again.

I was thinking it’s possible to change the duration of fastcgi cache, but I don’t know how I can do that.

I want to make fastcgi cache to last way longer than now because I don’t post a lot, I post maybe 2-3 times a week. That’s all. So how can I achieve this?

Thank you

@Deneb you can find the “fastcgi_cache_valid” parameter in /etc/nginx/conf.d/fastcgi.conf

To mention time for all cache, you can use fastcgi_cache_valid 60m; there are many more options available for the directive fastcgi_cache_valid, you can check different usages here,

Yes, That’s exactly what I was looking for.

Thanks a lot!