Grade F on Add Expires headers
12,755
Solution 1
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.
Solution 2
Set it in HTTP header is the most simple solution But, in my case I turn off PHP/server scripting engine running on pure nginx server and content is push through ftp (from backend-engine)
Author by
Fernando
Updated on June 04, 2022Comments
-
Fernando almost 2 years
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">