Welcome! Log In Create A New Profile

Advanced

Re: Nginx cache-control headers issue

Francis Daly
August 01, 2019 01:28PM
On Thu, Jul 25, 2019 at 12:02:27PM +0000, Andrew Andonopoulos wrote:

Hi there,

> Nginx decide which content to cache based on the configuration under "Location" + the cache key? For example I have proxy_cache which means will cache everything which match the specific location?
>

nginx caching is described at, for example,

https://www.nginx.com/blog/nginx-caching-guide/

with some more information at http://nginx.org/r/proxy_cache_valid

Whether the response from upstream is cached by nginx, depends on the
configuration and the details of the response.

Whether nginx responds to a client request with something from the cache,
also depends on the configuration.

And if you use third party modules, it is possible that they do something
that interferes with nginx's caching policy.

> I don't yet why I am getting cache miss for all the token based requests (m3u8 & ts), but I am wondering if is related to cache key and if will need to instruct neginx to check the token first and then cache it? Can this be done?
>

I'm afraid "try it and see" is the best I can suggest.

If you see everything using the cache as desired when the tokens are
not used, but failing to do that when the tokens are used, then you
get to play "spot the difference" between the two pairs of requests
and responses.

Can you see -- does the upstream response go into the nginx cache in
both cases? If not, what is different in the case where it does not go in?

If the response does do into the nginx cache, then presumably it is not
taken from the cache in one case -- what is different there, instead?


Is the "token" part of the cache key? And do different requests have
different tokens for the same content? If so, then the second request
will not try to read from the cache entry of the first request.

Good luck with it,

f
--
Francis Daly francis@daoine.org
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Nginx cache-control headers issue

andregr-jp July 18, 2019 06:38PM

Re: Nginx cache-control headers issue

Francis Daly July 19, 2019 06:48PM

Re: Nginx cache-control headers issue

andregr-jp July 19, 2019 08:34PM

Re: Nginx cache-control headers issue

andregr-jp July 19, 2019 09:48PM

Re: Nginx cache-control headers issue

Francis Daly July 20, 2019 03:40AM

Re: Nginx cache-control headers issue

andregr-jp July 20, 2019 06:12AM

Re: Nginx cache-control headers issue

Francis Daly July 21, 2019 08:28AM

Re: Nginx cache-control headers issue

andregr-jp July 25, 2019 08:04AM

Re: Nginx cache-control headers issue

Francis Daly August 01, 2019 01:28PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 130
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready