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.

We have a service that exposes a calculation service through a REST interface (accessed by GET). To me this sounds like a perfect candidate for caching responses, and after reading an article by Andy King on using Apache's mod_expire for caching, this seemed the way to go. I basically thought setting

ExpiresByType application/json "access plus 1 hour"

to cache the responses. The calculation service uses indexes that are updated from time to time, so it needs to refresh from time to time, but other than that, I cannot see any pitfalls. What other ways would you recommend to do server-side caching that does not mean touching the code itself?

share|improve this question

1 Answer 1

An Expires header gives you client-side caching (useful if the same client needs the same resource multiple times) but not server-side caching.

Since you're looking to cache server-side, mod_cache is what you need.

share|improve this answer
    
As in setting CacheEnable+CacheDefaultExpire 3600 (one hour)? This would effectively trigger caching on the server of a given URL for one hour, right? –  oligofren Jul 4 '12 at 9:00
    
@oligofren It may not necessarily be that simple depending on your content (headers and other factors can interfere), but yeah, that's the idea. –  Shane Madden Jul 4 '12 at 17:41

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.