Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have web hosting at MediaTemple. By default, is it likely to be set up to tell the browser to cache the images and other assets that are served?

If not, how do I set up the caching? And then how would I be sure that it was working? Feel free to point me to a good newbie caching tutorial.

A possible complication is that the images will be served to a JavaScript game in an iFrame in a Facebook app (although I'm guessing that's no different than the usual browser caching).

I don't want to serve the same images every time the user launches the game.

I'd like to set the the expiration date as long as possible. I'm fine with tacking a version number onto the filename when the asset changes.

I know this is a frightfully newbie question. I'm more comfortable with front-end programming than with server issues.

share|improve this question
add comment

3 Answers

up vote 1 down vote accepted

If the images are being served as static content (most likely) then they will generally be cached where possible and you don't need to do anything extra.

share|improve this answer
add comment

You may want to try with the Cache-Control directives, something like "Cache-Control: max-age=<time-in-seconds>"

share|improve this answer
add comment

If you want to make sure that stuff IS being cached, try the YSlow plugin for FireBug for FireFox. It will give you a breakdown of what is and is not cached on your page.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.