How can I force caching for 404 pages?


#1

Right now, 404 pages don’t generate a cache. Always having this header status:

X-SRCache-Fetch-Status	MISS
X-SRCache-Store-Status	BYPASS

#2

Please check https://github.com/openresty/srcache-nginx-module#srcache_store_statuses

We are using default.

May be you can ee site edit and add srcache_store_statuses 200 301 302 404; to it under server block.


#3

How about caching all request, regardless of http response status?


#4

I just added: srcache_store_statuses 200 201 301 302 404 503;

Thanks!


#5

I hope you are getting expected cache response header :slight_smile:


#6

You may report this on - https://github.com/openresty/srcache-nginx-module/issues/

Or simply add 500, 502 and 504. These together with 200 301 302 404 will cover most of HTTP traffic.


#7