.net - OutputCache serving long-stale data -


i'm flumoxed... re this , this "meta" questions...

a basic http request:

get http://stackoverflow.com/feeds/tag?tagnames=c%23&sort=newest http/1.1 host: stackoverflow.com accept-encoding: gzip,deflate 

which hits route decorated with:

[outputcache(duration = 300, varybyparam = "tagnames;sort",     varybycontentencoding = "gzip;deflate", varybycustom = "site")] 

is repeatedly and incorrectly serving either 304 (no change) if include if-modified-since, or the old data 200, i.e.

http/1.1 200 ok cache-control: public, max-age=0 content-type: application/atom+xml; charset=utf-8 content-encoding: gzip expires: fri, 01 jul 2011 09:17:08 gmt last-modified: fri, 01 jul 2011 09:12:08 gmt vary: * date: fri, 01 jul 2011 09:42:46 gmt content-length: 14714 (payload, when decoded = long-stale data) 

as can see, serving half hour past 5 minute slot; looks internals of outputcache didn't notice time ;p expire eventually (in fact, has done - fri, 01 jul 2011 09:56:20 gmt request got fresh data), not anywhere punctually.

update:

i believed working if took away accept-encoding header, no; fails - fails on different cycle (which should expect since keys different, courtesy of varybycontentencoding):

get http://stackoverflow.com/feeds/tag?tagnames=c%23&sort=newest http/1.1 host: stackoverflow.com 

gives:

http/1.1 200 ok cache-control: public, max-age=0 content-type: application/atom+xml; charset=utf-8 expires: fri, 01 jul 2011 10:09:58 gmt last-modified: fri, 01 jul 2011 10:04:58 gmt vary: * date: fri, 01 jul 2011 10:17:20 gmt content-length: 66815 (payload = stale data) 

once again, you'll notice being served after expires.

so: wrong here?

additional; while using custom option, our getvarybycustomstring() correctly calls base.getvarybycustomstring(ctx, custom) options doesn't recognise, per msdn (indeed works fine second example above).

is there chance you're using custom output cache provider? hypothetically, if there custom provider using sliding expiration instead of absolute one, you'd see symptoms this.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -