Welcome! Log In Create A New Profile

Advanced

RE: Check if a resource is in the cache

Reinis Rozitis
October 30, 2019 02:28AM
> Hello,
>
> is there a way to check if a requested resource is in the cache?
>
> For example, “if” has the option “-f”, which could be used to check if a static
> file is present.
>
> Is there something similar for a cached resource?

Depending on what you want to achieve you could check $upstream_cache_status for 'HIT' ( http://nginx.org/en/docs/http/ngx_http_upstream_module.html?#var_upstream_cache_status )

rr

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Check if a resource is in the cache

roger_bc October 29, 2019 04:46PM

RE: Check if a resource is in the cache

Reinis Rozitis October 30, 2019 02:28AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 49
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready