iis - ASP.NET and YSlow optimization -


i'm running yslow performance test on small asp.net web project running in iis express. i'm left 2 items think needs optimization.

1. add expires headers

i need set expire date on favicon.ico. how can this?

enter image description here

2. primed cache

when in statistics tab, notice html not cached. how can cache html, 6,7k not downloaded second time? why favicon requsted in primed cache?

enter image description here

favicon:

add web.config file:

<configuration>   <location path="favicon.ico">     <system.webserver>       <staticcontent>         <clientcache cachecontrolmode="usemaxage" cachecontrolmaxage="90.00:00:00" />       </staticcontent>     </system.webserver>   </location> </configuration> 

html cache:

the browser caches page based on response headers of server response. should ask browser cache page if page contents not change given period of time , user revisit page in given period.

you set cache header using like:

response.cache.setcacheability(httpcacheability.public); response.cache.setmaxage(new timespan(1, 0, 0)); 

i recommend take @ w3c http cache specifications full overview browser cache.

also, if use cache, browsers ask server if file modified since last time them (the "if-modified-since" header). if file not changed, can respond 304 status code.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -