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?

1 Answer 1


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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