Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

closed as off-topic by masegaloeh, Jenny D, mdpc, 84104, Katherine Villyard Apr 16 '15 at 21:25

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions should demonstrate reasonable business information technology management practices. Questions that relate to unsupported hardware or software platforms or unmaintained environments may not be suitable for Server Fault - see the help center." – masegaloeh, Jenny D, mdpc, 84104, Katherine Villyard
If this question can be reworded to fit the rules in the help center, please edit the question.

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

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

share|improve this answer

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

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