I was looking at the setup of reverse proxies, like nginx in front of apache, to reduce load on webservers for serving static content.

For any given URL, our web pages will have different parts static and dynamic. How do reverse proxies know when to serve resources themselves, or pull it from the source web server behind them? Obviously things like images and javascript files are static, but even some of those, like captchas, are dynamically generated. Our drupal sites actually look at the path in the url and serve different content accordingly, taking path elements as arguments.

Does it simply require a lot of configuration on the reverse-proxy side, with the configurator having deep knowledge about which parts of the site are dynamic versus static?


Reverse proxies can distinguish static contents from dynamic ones the same way forward proxies do: using caching informations in the HTTP headers.

HTTP includes some fields specifically to tell browsers (and proxies) what can be cached and for how much time; reverse proxies can (and do) analyze these fields in order to know when cached responses expire.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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