Skip to content

fix(cache): uploads are now cached "private, must-revalidate"#498

Merged
TrueBrain merged 1 commit intomainfrom
fix-cache
Aug 9, 2023
Merged

fix(cache): uploads are now cached "private, must-revalidate"#498
TrueBrain merged 1 commit intomainfrom
fix-cache

Conversation

@TrueBrain
Copy link
Copy Markdown
Owner

@TrueBrain TrueBrain commented Aug 9, 2023

And favicon.ico is cached like all other static files.

The reason for this change is because people find it annoying to
wait for an updated image to appear. By allowing private caching,
but require revalidation, this is avoided. Sadly it also means
proxies will no longer cache the entry.
As a bonus, we can now extend the cache time to an hour, so
browsing the wiki is more smooth during that hour.

Also, only cache uploads that have a Last-Modified header,
as otherwise revalidation is pointless.

@TrueBrain TrueBrain added the preview Deploy this Pull Request to Preview label Aug 9, 2023
@codecov
Copy link
Copy Markdown

codecov bot commented Aug 9, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (1b26d0e) 83.69% compared to head (817acd5) 83.69%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #498   +/-   ##
=======================================
  Coverage   83.69%   83.69%           
=======================================
  Files          52       52           
  Lines        2773     2773           
  Branches      430      429    -1     
=======================================
  Hits         2321     2321           
  Misses        342      342           
  Partials      110      110           
Files Changed Coverage Δ
truewiki/__main__.py 87.96% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@TrueBrain TrueBrain temporarily deployed to Preview August 9, 2023 09:58 — with GitHub Actions Inactive
@TrueBrain TrueBrain force-pushed the fix-cache branch 2 times, most recently from 176c078 to 7064556 Compare August 9, 2023 10:02
@TrueBrain TrueBrain changed the title fix(cache): ensure uploads are revalidated, and cache favicon.ico too fix(cache): uploads are now cached with max-age=0 Aug 9, 2023
@TrueBrain TrueBrain temporarily deployed to Preview August 9, 2023 10:06 — with GitHub Actions Inactive
@TrueBrain TrueBrain temporarily deployed to Preview August 9, 2023 10:15 — with GitHub Actions Inactive
@TrueBrain TrueBrain temporarily deployed to Preview August 9, 2023 10:24 — with GitHub Actions Inactive
And favicon.ico is cached like all other static files.

The reason for this change is because people find it annoying to
wait for an updated image to appear. By allowing private caching,
but require revalidation, this is avoided. Sadly it also means
proxies will no longer cache the entry.
As a bonus, we can now extend the cache time to an hour, so
browsing the wiki is more smooth during that hour.

Also, only cache uploads that have a Last-Modified header,
as otherwise revalidation is pointless.
@TrueBrain TrueBrain temporarily deployed to Preview August 9, 2023 10:35 — with GitHub Actions Inactive
@TrueBrain TrueBrain changed the title fix(cache): uploads are now cached with max-age=0 fix(cache): uploads are now cached "private, must-revalidate" Aug 9, 2023
@TrueBrain TrueBrain merged commit 1484045 into main Aug 9, 2023
@TrueBrain TrueBrain deleted the fix-cache branch August 9, 2023 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

preview Deploy this Pull Request to Preview

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants