[PR #20] [MERGED] PHP overriding caching #133

Closed
opened 2026-02-25 23:40:51 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/HaschekSolutions/pictshare/pull/20
Author: @gabe565
Created: 11/3/2016
Status: Merged
Merged: 11/3/2016
Merged by: @geek-at

Base: masterHead: master


📝 Commits (2)

  • a509438 Tell PHP to cache for 90 days before session
  • f070735 Add cache changes to backend.php also

📊 Changes

2 files changed (+6 additions, -0 deletions)

View changed files

📝 backend.php (+3 -0)
📝 index.php (+3 -0)

📄 Description

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!


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/HaschekSolutions/pictshare/pull/20 **Author:** [@gabe565](https://github.com/gabe565) **Created:** 11/3/2016 **Status:** ✅ Merged **Merged:** 11/3/2016 **Merged by:** [@geek-at](https://github.com/geek-at) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (2) - [`a509438`](https://github.com/HaschekSolutions/pictshare/commit/a509438b537c1da84876a48b94006d9182e011a6) Tell PHP to cache for 90 days before session - [`f070735`](https://github.com/HaschekSolutions/pictshare/commit/f07073522fdb24b423d011e0bc3e74f2c6d86baf) Add cache changes to backend.php also ### 📊 Changes **2 files changed** (+6 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `backend.php` (+3 -0) 📝 `index.php` (+3 -0) </details> ### 📄 Description 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](https://github.com/chrisiaut/pictshare/blob/52a4258bb3b584bc572a0cf42c9920c25ed1ea60/inc/core.php#L369), 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](https://www.pictshare.net/). 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! --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-25 23:40:51 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/pictshare#133
No description provided.