0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-05 17:25:34 +08:00
discourse/config
Régis Hanol f5cd83cab6
FIX: Prevent browsers from restoring stale documents in bfcache mode (#42207)
Previously, enabling `cache_control_bfcache_compatibility` (the
experiment currently running on meta, #38763) made HTML documents
storable in the browser HTTP cache, and browsers skip revalidation on
history navigations — so back/forward, session restore, and
discarded-tab reloads could resurrect a days-old document: stale topic
lists that only get older, and logged-in UI shown to logged-out sessions
(and vice versa). Reported in https://meta.discourse.org/t/400459.

This change keeps the documents out of shared caches (`no-cache,
private`), reloads any document that was served from the HTTP cache on a
history navigation (navigation entry with `type === "back_forward"` and
`transferSize === 0` — a forced reload gets type `"reload"`, so it
cannot loop), and validates the session on `pageshow` restores from the
back/forward cache, reloading when the logged-in user no longer matches
the one the page booted with. Both client-side checks only run when the
setting is enabled; the full rationale (browser-engine specifics, why
`transferSize` rather than `deliveryType`, why `fetch` rather than
`ajax`) is in the commit message.

Reproduced and verified end-to-end in Chromium and Firefox: with the
setting enabled, `goBack()` served `/latest` with zero network contact —
stale list, wrong login state, and the exact `403
/u/:username/private-message-topic-tracking-state` errors from the meta
report; with this change the same navigation heals with a single
automatic reload, and a control run with the setting disabled behaves as
before.
2026-07-31 17:24:47 +02:00
..
environments DEV: Enable Rails/FilePath rubocop rule (#40097) 2026-05-19 19:07:54 +02:00
imagemagick FIX: Render topic OG images under ImageMagick policy (#42125) 2026-07-30 08:12:33 +08:00
initializers FIX: Do not notify new sites or plugins enabled of old upcoming changes (#42045) 2026-07-30 09:51:08 +10:00
locales I18N: Update translations (#42204) 2026-07-31 14:55:19 +02:00
application.rb DEV: Retroactive review and refactor of custom emoji bulk import/export (#41860) 2026-07-22 10:06:54 +10:00
boot.rb DEV: Change test formatters (#39427) 2026-04-22 12:26:07 +02:00
cdn.yml.sample
database.yml DEV: Support per-unicorn-worker DB variable overrides (#35615) 2025-10-27 13:45:27 +08:00
deploy.rb.sample
dev_defaults.yml DEV: Add admin_dashboard:populate rake task to seed Site Traffic (#39775) 2026-05-06 12:07:47 +08:00
discourse.config.sample
discourse.pill.sample DEV: Move puma to test-only dependency (#38652) 2026-03-18 05:23:12 +08:00
discourse_defaults.conf FEATURE: Add opt-in IAM role assumption for S3 operations (#39174) 2026-04-15 04:29:50 +08:00
environment.rb DEV: Add env var for local email port (#36900) 2025-12-31 14:25:02 +10:00
logrotate.conf
multisite.yml.production-sample
nginx.sample.conf DEV: remove x-real-ip references (#41371) 2026-07-03 15:53:21 -04:00
official_plugins.json DEV: Remove deprecated themes/plugins from the list (#41948) 2026-07-23 13:06:14 +02:00
pitchfork.conf.rb DEV: Rename EmberCli to EmberAssets (#40938) 2026-06-16 12:56:56 +02:00
projections.json DEV: Prepare for rename of app/assets/javascripts/ -> frontend/ 2025-10-22 16:24:11 +01:00
routes.rb FEATURE: Log staff actions for admin onboarding panel steps (#42032) 2026-07-24 14:43:01 -07:00
sidekiq.yml
site_settings.yml FIX: Prevent browsers from restoring stale documents in bfcache mode (#42207) 2026-07-31 17:24:47 +02:00
spring.rb
thin.yml.sample
unicorn_launcher DEV: Enable Pitchfork by default (#37679) 2026-02-11 11:52:39 +01:00