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?
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.