Minimal Example of Caching Reverse Proxy for One URL?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Can anyone point me to a minimal example of configuring a reverse proxy for a single .js URL, where the local server caches the Javascript file and serves it with appropriate headers, like Expires, Last-Modified, Cache-Control, etc., and maybe even a 304 response if the request includes If-Modified-Since?

My use case: I use plausible.io for privacy-respecting web stats. Plausible discusses the need to proxy their Javascript here:

https://plausible.io/docs/proxy/introduction

Here's what I have so far, in my VirtualHost:

    SSLProxyEngine on
    ProxyPass "/api/event" "https://plausible.io/api/event";
    ProxyPass "/p.js" "https://plausible.io/js/plausible.js";

That's working on my web site, but always serving a fresh copy of the Javascript:

https://ony.ms/

I've read some cookbook articles on reverse proxies and caching with Apache, including:

https://httpd.apache.org/docs/2.4/howto/reverse_proxy.html

https://taylor.callsen.me/creating-a-caching-proxy-server-with-apache/

But I want to proxy and cache only this one location. I've read a lot of the Apache documentation on mod_proxy and mod_cache, but it would take much time to really understand it.

I hope someone here can give me a cookbook example I can learn from!

Thanks!

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx




[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux