We proxy images as licensed content and need to add max-age headers to the proxied images. Attempted modifying .htaccess
, but it didn't work and suspect this is due to the proxied image folder not being an actual directory on the server.
First, the proxy is set up in apache2.conf
:
# Image Proxy
ProxyPass /photo http://photo.licensor.com
ProxyPassReverse /photo http://photo.licensor.com
Made several attempts to modify .htaccess
under the site's public_html directory. It appears that the condition to modify the max-age header for proxied images is never recognized by Apache since /photo
is not a real directory.
I'd really like to target ONLY the proxied images using the /photo
directory that isn't real.
You can't use a <location>
container in an htaccess file. It's probably best to put this in your apache server config file next to your ProxyPass
settings:
<LocationMatch "/photo">
# Image Proxy
ProxyPass http://photo.licensor.com
ProxyPassReverse http://photo.licensor.com
Header unset Etag
Header set Cache-Control "max-age=86400, public"
Header unset Expires
</LocationMatch>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With