HaschekSolutions / pictshare

:camera: PictShare is an open source image, mp4, pastebin hosting service with a simple resizing and upload API that you can host yourself. :rice_scene:
https://www.pictshare.net
Apache License 2.0
845 stars 126 forks source link

PHP overriding caching #20

Closed gabe565 closed 8 years ago

gabe565 commented 8 years ago

I noticed that images uploaded to PictShare were never being cached by any browser.

I looked through the code, and saw in inc/core.php, it is attempting to set the cache Expires header for images and videos to 90 days, but most PHP configs will override this and completely disable caching (Even if Pragma and Cache-Control are unset).

This happened on my personal server and on the public site.

If I changed this setting on a global level, it broke other PHP pages, but setting PHP's cache_limiter to public does not seem to do any harm to PictShare, and images are cached now!

geek-at commented 8 years ago

awesome, thanks