Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I am trying to improve my site's performance - and that includes caching.

I found some great caching via .htaccess from the boilerplate html5 template - but the cache times seem odd.

Does anyone have ideal or preferred caching times for their php/html, js, css, and image files?

share|improve this question
add comment

1 Answer

There is no ideal length. It all depends on how often this content changes for you (and the files usually cached should not change often). I'm not in front my the code for my personal website but that content rarely changes so I have it set to be a week or two IIRC. If your content changes on a daily basis then a 24 hour expiration seems appropriate.

Basically base this decision on how often your content changes and what you feel comfortable with.

See a similar question on Stack Overflow.

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.