views:

736

answers:

2

Hi, I used the YSlow Firefox add-on and it return the follow result:

Grade F on Add Expires headers

There are 8 static components without a far-future expiration date.

* (no expires) http://localhost:63808/WebSite/css/Global.css?...
* (no expires) http://localhost:63808/WebSite/css/BemVindo.css?...
* (no expires) http://localhost:63808/WebSite/js/Global.js?...
* (no expires) http://localhost:63808/WebSite/js/BemVindo.js?...
* (no expires) http://www.maplist.com.br/img/faixa_verde.png
* (no expires) http://www.maplist.com.br/img/logo_home.png
* (no expires) http://www.maplist.com.br/img/wait_bar.gif
* (2010/1/23) http://localhost:63808/WebSite/favicon.ico

I resolve the problem using a HttpHandler component:

www.codeproject.com/KB/aspnet/CssAndJavaScriptOptimizer.aspx

Is there a easier way to resolve the problem? Maybe in global.asax?

By the way, I'm using this metas in my page:

<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="PUBLIC"> 
<META HTTP-EQUIV="EXPIRES" CONTENT="Mon, 22 Jul 2010 11:12:01 GMT">
+2  A: 

You have to change the Expires: header of these pages to make them expire in the far future, allowing user browsers to cache them.

You can use mod_expires in apache, or this technique. Here is an article explaining how to do it with IIS.

Valentin Rocher
-1, I think he knows the what, YSlow tells him, not the how.
Malfist
then how do you answer his question ? without knowing the server technology, that's pretty much everything I can tell him.
Valentin Rocher
Link him info on how to do it on the two most popular servers, like Apache or IIS.
Malfist
done ! thanks for the idea malfist
Valentin Rocher
removed the down vote. :)
Malfist
I don't have server access, I have to do this in code. I'm trying to do this using a HttpHanlder, but I think that may have a easier way to do this. By the way, I'm using this metas in my page:<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="PUBLIC"><META HTTP-EQUIV="EXPIRES" CONTENT="Mon, 22 Jul 2010 11:12:01 GMT">
Fernando
I resolve the problem using a HttpHandler component:www.codeproject.com/KB/aspnet/CssAndJavaScriptOptimizer.aspxIs there a easier way to resolve the problem? Maybe in global.asax?
Fernando
A: 

IIS allows you to set the Expires header automatically on all static content served. This is the method that I typically use.

Nick Berardi
I don't have IIS acces... =/
Fernando
I believe Apache has the same ability. But I am much less versed in it than IIS.
Nick Berardi