Welcome! Log In Create A New Profile

Advanced

Cache question

Posted by Friscia, Michael 
Friscia, Michael
Cache question
June 28, 2018 03:30PM
I’m working through use cases for cache in a presentation and had a thought jump into my head. We have a server block where most things are cached, but a few locations are set not to use the cache. But the thought is that even thought we don’t want to use a local cache and always fetch from upstream, is it possible to still keep a cache copy that could then be served if the upstream host sends anything other than a 200 response?

___________________________________________
Michael Friscia
Office of Communications
Yale School of Medicine
(203) 737-7932 - office
(203) 931-5381 - mobile
http://web.yale.eduhttp://web.yale.edu/

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Peter Booth
Re: Cache question
June 28, 2018 06:50PM
Sure is. Look at the stale-if-error stale-while-revalidate proxy_cache_use_stale proxy_cache_lock etc

Can you describe the use case a bit more? Why don't you want to cache this particular content?
Is it that its dynamic and a fresher version is always preferable but the stale is good enough in
the event of an error? Or is there more to it than that?

Sometimes people build sites that are “more dynamic” than they need to because they didn't
consider a static site that gets frequently periodically regenerated.

Peter

> On 28 Jun 2018, at 9:27 AM, Friscia, Michael <[email protected]> wrote:
>
> I’m working through use cases for cache in a presentation and had a thought jump into my head. We have a server block where most things are cached, but a few locations are set not to use the cache. But the thought is that even thought we don’t want to use a local cache and always fetch from upstream, is it possible to still keep a cache copy that could then be served if the upstream host sends anything other than a 200 response?
>
> ___________________________________________
> Michael Friscia
> Office of Communications
> Yale School of Medicine
> (203) 737-7932 - office
> (203) 931-5381 - mobile
> http://web.yale.edu http://web.yale.edu/
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org <mailto:[email protected]>
> http://mailman.nginx.org/mailman/listinfo/nginx http://mailman.nginx.org/mailman/listinfo/nginx
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Friscia, Michael
Re: Cache question
June 28, 2018 07:20PM
Yes, the content is dynamic, basically a set of JSON RESTful applications we call feeds that for specific reasons we do not cache but most we do. The use-case is simple, if we have to release new code these feeds are down/returning a 503 error but if we had a cache that would serve stale during that time, then, in theory, our feeds would never go down.

As for the dynamic site thing, I completely agree. We have very dynamic content that we still cache. Much of our site is built using taxonomy driven feeds but even with our search box, the standard searches are all cached since we know the most common medical terminologies that will be queried. But for the things we can’t cache, it would be pretty bad.

Thanks for the commands to look at, this will be really helpful.

___________________________________________
Michael Friscia
Office of Communications
Yale School of Medicine
(203) 737-7932 - office
(203) 931-5381 - mobile
http://web.yale.eduhttp://web.yale.edu/


From: nginx <[email protected]> on behalf of Peter Booth <[email protected]>
Reply-To: "[email protected]" <[email protected]>
Date: Thursday, June 28, 2018 at 12:46 PM
To: Wiktor Kwapisiewicz via nginx <[email protected]>
Subject: Re: Cache question

Sure is. Look at the stale-if-error stale-while-revalidate proxy_cache_use_stale proxy_cache_lock etc

Can you describe the use case a bit more? Why don't you want to cache this particular content?
Is it that its dynamic and a fresher version is always preferable but the stale is good enough in
the event of an error? Or is there more to it than that?

Sometimes people build sites that are “more dynamic” than they need to because they didn't
consider a static site that gets frequently periodically regenerated.

Peter

On 28 Jun 2018, at 9:27 AM, Friscia, Michael <[email protected]<mailto:[email protected]>> wrote:

I’m working through use cases for cache in a presentation and had a thought jump into my head. We have a server block where most things are cached, but a few locations are set not to use the cache. But the thought is that even thought we don’t want to use a local cache and always fetch from upstream, is it possible to still keep a cache copy that could then be served if the upstream host sends anything other than a 200 response?

___________________________________________
Michael Friscia
Office of Communications
Yale School of Medicine
(203) 737-7932 - office
(203) 931-5381 - mobile
http://web.yale.eduhttps://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fweb.yale.edu%2F&data=02%7C01%7Cmichael.friscia%40yale.edu%7Cbe310a70a3d6424b5da808d5dd16bc45%7Cdd8cbebb21394df8b4114e3e87abeb5c%7C0%7C1%7C636658012081469073&sdata=RvVm3PBAcOtxR1Zh7jmjAl8z2slBvj%2FzYAWmXOy0hUE%3D&reserved=0

_______________________________________________
nginx mailing list
[email protected]<mailto:[email protected]>
http://mailman.nginx.org/mailman/listinfo/nginxhttps://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmailman.nginx.org%2Fmailman%2Flistinfo%2Fnginx&data=02%7C01%7Cmichael.friscia%40yale.edu%7Cbe310a70a3d6424b5da808d5dd16bc45%7Cdd8cbebb21394df8b4114e3e87abeb5c%7C0%7C1%7C636658012081479070&sdata=ibc%2BSaQcAVTewPaypsHFAfHwI8kuIqqcesbSNu6ZkRM%3D&reserved=0

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Sorry, only registered users may post in this forum.

Click here to login