asp.net mvc 3 - How to properly set content caching for a .Net application running in IIS? -


in mvc3 project have following class-level attributes set on of controllers:

 [outputcache(location = system.web.ui.outputcachelocation.server, duration = 14400, varybyparam = "*")] 

duration = 4 hours.

i used varybyparam = "*" there differing parameters controller's action methods, instead of varybyparam = "none" - correct use?

in iis, on server level , in web.config files sites, set static caching 8 days.

observing headers in fiddler, when go search result page, see following:

http/1.1 200 ok cache-control: no-cache pragma: no-cache content-type: text/html; charset=utf-8 expires: -1 vary: accept-encoding server: microsoft-iis/7.5 x-aspnetmvc-version: 3.0 x-aspnet-version: 4.0.30319 x-powered-by: asp.net date: thu, 15 aug 2013 17:21:32 gmt content-length: 148842 

for site scripts js files:

http/1.1 200 ok cache-control: max-age=691200 content-type: application/x-javascript last-modified: thu, 15 aug 2013 05:35:35 gmt accept-ranges: bytes etag: "10906a447999ce1:0" vary: accept-encoding server: microsoft-iis/7.5 x-powered-by: asp.net date: thu, 15 aug 2013 17:21:32 gmt content-length: 2999 

and css:

http/1.1 304 not modified cache-control: max-age=691200 last-modified: wed, 07 aug 2013 21:31:28 gmt accept-ranges: bytes etag: "f08ce079b593ce1:0" server: microsoft-iis/7.5 x-powered-by: asp.net date: thu, 15 aug 2013 17:21:33 gmt 

using google's pagespeed affiliate (http://www.webpagetest.org/) able around 90/100 on pages - page load time 4 seconds, report shows .47s optimized - see confusing results here . when playback video on webpagetest of original vs. optimized, original finishes in 2.5s (and has lower speed index) , optimized in 4.7s.

google's pagespeed insights suggests optimize css delivery. serving css asynchronously.

as hosting on aws, cranked juice on instance 1 of powerful server instances. page load times same regular instance.

so confused first result top: cache-control: no-cache . have not implemented caching correctly, , if not, missing?


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -