I wanted to set up caching on all the junk my webserver serves, but I would like a good idea of what production-level services use cache wise? For some reason I can't pick my own times for things like js, css, png, jpg, etc.
I wanted to set up caching on all the junk my webserver serves, but I would like a good idea of what production-level services use cache wise? For some reason I can't pick my own times for things like js, css, png, jpg, etc.
The exact method used to set the cache headers varies depending on which web server you're using.
In IIS 6, for example, you can right-click on any folder or file from within the IIS management console, select Properties, and set the content expiration however long you like (under the HTTP Headers tab).
In IIS7 select the folder (or file from the content view), and open the "HTTP Response Headers" module. From the actions pane, select "Set Common Headers..." and activate content expiration.
I generally group different types of files under different folders. The CSS files would be in a styles folder, images go in an images folder, etc. You can set different expiration times for each of these folders. For CSS you might set it to a few days. JavaScript might be a week. For images I usually select anywhere from 7 to 30 days depending on the site. You should select your own expiration times based on how often the site is updated.