Is this dynamic caching scenario possible with reverse proxy?
807567Aug 16 2008 — edited Aug 18 2008I'm considering using the Sun System Java Web Server as a reverse proxy in front of other SSJWS's running a java webapp. I'm creating a dynamic site where most of the pages change only occasionally. I'm wondering if the follow "dream compression/caching" scenario is possible:
- Origin web servers have a set of high traffic dynamic pages that change only occasionally. Other pages (could be partition in subdirs) should not be cached.
- These dynamic pages set cache and expires headers allowing browser and proxies to cache the content--say for hours or days. It's ok if users see a slightly stale page within this expiration period.
- Reverse proxy caches these pages as if they were static files. They also create gzipped versions on the fly and cache those. When requests comes in for these specific pages, they are served straight from proxy cache (either compressed or uncompressed depending on request header.)
- When the expiration date is reached, reverse proxy requests fresh pages from the origin server, creates a compressed version, and only servies these pages from cache.
- A certain set of pages shouldn't be cached and will have appropriate headers. They will probably also be in different subdirectories.
Is it possible to use the reverse proxy as a self-updating cache this way? (And it it possible to proactively invalidate the cache. Let's say I change a page on the origin and I want the proxy to refresh that cached page right away.)
Thank you,
Armando