# Getting fastcgi\_no\_cache to cache the fresh response

**URL:** <https://www.ruby-forum.com/t/getting-fastcgi-no-cache-to-cache-the-fresh-response/205859>\
**Category:** NGINX\
**Created:** [April 17, 2011, 1:25pm UTC](https://www.ruby-forum.com/t/getting-fastcgi-no-cache-to-cache-the-fresh-response/205859 "2011-04-17T13:25:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [April 17, 2011, 1:25pm UTC](https://www.ruby-forum.com/t/getting-fastcgi-no-cache-to-cache-the-fresh-response/205859/1 "2011-04-17T13:25:56Z")

</div>

I have been trying to find a good and standard way of invalidating nginx  
fastcgi cache. Some time ago we had the fastcgi\_cache\_bypass filter  
which was not completely implemented and didn’t work (and has been  
removed from the wiki since). Now the only option seems to be  
fastcgi\_no\_cache.

Is there a way to cache that fresh response from the backend when  
fastcgi\_no\_cache is 1?

Like this:

1. Nginx receives a request with fastcgi\_no\_cache 1
2. Nginx skips cache and returns a fresh response from the backend
3. Nginx stores that response in the cache
4. All of the subsequent requests when fastcgi\_no\_cache 0 (with the same  
cache\_key) return that latest cached response.

Kaspars

Posted at Nginx Forum:

> **[Getting fastcgi\_no\_cache to cache the fresh response](https://forum.nginx.org/read.php?2,191844,191844#msg-191844)**
>
> I have been trying to find a good and standard way of invalidating nginx fastcgi cache. Some time ago we had the fastcgi\_cache\_bypass filter which was not completely implemented and didn't work (and has been removed from the wiki since). Now the only...
