Using asp.net in visual studios and IIS7 when i get a host.
I have a folder full of icons that will rarely change and is used on every page. Is there a way i can set a certain directory to expire something like once every 2 or so hours so i can decrease the amount of incoming request to the server?
You do that in IIS. If you are using IIS 7, you can add the header in your web.config. It’s in the system.webServer section.
This will cause all static content to have an expires HTTP header set to the year 2020. Static content means anything that isn’t served through the ASP.NET engine such as images, script files and styles sheets.
Or to use a relative expiration, use this:
This will cause all static content to have an expires HTTP header set to 2 days.