<p class="MsoNoSpacing">Hi all,</p>
<p class="MsoNoSpacing">I guess many people didn't understand my question. </p>
<p class="MsoNoSpacing">To make it simple, Can I have two caching strategies together:</p><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><p class="MsoNoSpacing">one
for logged in users and one for non-logged in users in the same location directive? </p></blockquote>
<p class="MsoNoSpacing">-Quintin</p><br><div class="gmail_quote">On Sun, Mar 4, 2012 at 8:56 PM, Quintin Par <span dir="ltr"><<a href="mailto:quintinpar@gmail.com">quintinpar@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="gmail_quote"><p>Hi all,</p>
<p>I currently have a good caching solution for non-logged
in users as shown below </p>
<p class="MsoNormal">location / {</p>
<p class="MsoNormal"> proxy_pass <a href="http://localhost:82" target="_blank">http://localhost:82</a>;</p>
<p class="MsoNormal"> proxy_set_header Host $host;</p>
<p class="MsoNormal">
proxy_set_header X-Real-IP $remote_addr;</p>
<p class="MsoNormal">
proxy_set_header
X-Forwarded-For
$proxy_add_x_forwarded_for;</p>
<p class="MsoNormal"> proxy_set_header
Accept-Encoding "";</p>
<p class="MsoNormal"> proxy_ignore_headers
Set-Cookie; </p>
<p class="MsoNormal"> proxy_ignore_headers
Cache-Control; </p>
<p class="MsoNormal"> proxy_ignore_headers
Expires; </p>
<p class="MsoNormal"> proxy_ignore_headers
X-Accel-Expires; </p>
<p class="MsoNormal"> proxy_no_cache
$cookie_sessionid;</p>
<p class="MsoNormal"> proxy_cache_bypass
$cookie_sessionid;</p>
<p class="MsoNormal"> proxy_cache cache;</p>
<p class="MsoNormal"> proxy_cache_key $scheme$host$request_uri; </p>
<p class="MsoNormal">
proxy_cache_valid 200 302
5m;</p>
<p class="MsoNormal"> proxy_cache_valid
404 1m;</p>
<p class="MsoNormal">
proxy_cache_use_stale updating;</p>
<p class="MsoNormal">}</p>
<p>But this is proving to be a lot of load when accessed by
logged-in users(with cookie). Typically situations like homepage (collection of
a lot of snippets) </p>
<p>So in the same location directive, <b>how can I apply an
additional caching strategy with SSI on</b>(users name details which needs to be
pulled up every time) for logged in users. Say cache pages for logged in users
for a minute with caching for non logged in users at 15 minutes. I also want </p>
<p>
proxy_cache_bypass $cookie_sessionid;</p>
<p>to refresh cache entries. </p><p>I believe this is scenario for a lot of websites out there. </p>
<p>Can someone help please? </p><span class="HOEnZb"><font color="#888888"><span><font color="#888888">
<p>-Quintin</p>
</font></span></font></span></div><br>
</blockquote></div><br>