Different cache time for authentication & non auth users

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Different cache time for authentication & non auth users

Quintin Par

Hi all,

How can I set separate caching expiration time for authenticated and non auth users?

In my case the caching is set this way

proxy_cache_key         $scheme$host$request_uri$cookie_sessionid;

proxy_cache_valid       200 302 2m;

proxy_cache_use_stale   updating;

The presence of session ID ensure separate cache pages for auth & non auth users.

But I want an experience where non auth users have a page cached for 1 hour and auth users have a page cached for 2 mins.

How can I achieve this in Nginx? Can someone help?

FYI, this is under the same location directive.

- Quintin 


_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx
Reply | Threaded
Open this post in threaded view
|

Re: Different cache time for authentication & non auth users

Quintin Par

Hi,

Can someone help? I don’t want to end up using if case.

- Quintin

On Sun, Oct 21, 2012 at 8:47 AM, Quintin Par <[hidden email]> wrote:

Hi all,

How can I set separate caching expiration time for authenticated and non auth users?

In my case the caching is set this way

proxy_cache_key         $scheme$host$request_uri$cookie_sessionid;

proxy_cache_valid       200 302 2m;

proxy_cache_use_stale   updating;

The presence of session ID ensure separate cache pages for auth & non auth users.

But I want an experience where non auth users have a page cached for 1 hour and auth users have a page cached for 2 mins.

How can I achieve this in Nginx? Can someone help?

FYI, this is under the same location directive.

- Quintin 



_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx