My ur..." /> My ur..." /> My ur..."/>

Why is asp.net outputcache being session specific?

289 views Asked by At

I'm trying to implement the outputcache in my .aspx page. My directive goes like this

< %@ OutputCache Duration="600" VaryByParam="*" %>

My urls usually look like this. http://example.com/{location}/offers/{category}

But during testing I discovered that the cache seems to work within sessions only. i.e. requests from the same computer for the same URL returns a cached page, where requests from a different computer fr the same url returns a fresh page. And, there is nothing in my parameters that changes with sessions / users. Anyone here know how to fix it to work across sessions, please share your thoughts.

1

There are 1 answers

0
Al Davinci Leonardo On BEST ANSWER

Fixed. Found out that another programmer had left this code in aspx.cs, while doing code for mobile handling.

context.Response.Cache.VaryByHeaders.UserAgent = true;

Turned that off, and now outputcache works across sessions. Great !