问题
I have a website and when I check page speed with Google plug-in, I receive:
Leverage browser caching
The following resources are missing a cache expiration
Searching only returns information on using htaccess under Apache, but my site is running on Windows 2003 Server, in plain HTML language, and I don't even have access to the server.
Is there any way to specify expiration and gzip compression, as it recommends?
回答1:
Have a look at Content Expiration, that should do the trick for you on the caching.
http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/0fc16fe7-be45-4033-a5aa-d7fda3c993ff.mspx?mfr=true
To set the expiration of Web site content
In IIS Manager, double-click the local computer; right-click the Web Sites folder, an individual Web site folder, a virtual directory, or a file; and then click Properties.
Click the HTTP Headers tab.
Select the Enable content expiration check box.
Click Expire immediately, Expire after, or Expire on, and type the appropriate expiration information in the corresponding boxes.
Click OK.
回答2:
You can also Gzip by adding the code below to the top of your PHP pages.
It works great.
来源:https://stackoverflow.com/questions/1994223/leverage-browser-caching