Preview link cached in CDN

Created on 26 February 2024, 10 months ago
Updated 1 April 2024, 9 months ago

I'm having problems with preview-links in a production environment that is using a CDN.

To reproduce, create a preview link for a piece of content.

Open the preview link an incognito browser.

Then make changes to the content in the first browser.

Reload in the incognito browser.

In my testing this only happened in a production environment. I could track it down to the cache-control header being set to

cache-control: max-age=31269, public

I think there should be an option to change this, in my case to "max-age=0" equivalent to "must-revalidate, no-cache, private"

πŸ› Bug report
Status

Needs work

Version

2.1

Component

Code

Created by

miiimooo Europe

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

  • Issue created by @miiimooo
  • Status changed to Needs review 10 months ago
  • miiimooo Europe

    Attached is a patch that sets responses from the preview link controller to max-age=0, making them un-cacheable.

    I'm open for better suggestions but in many cases this will be the desired behaviour. The impact on performance should negligible as preview-links are mainly shared in smaller groups

  • Issue was unassigned.
  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    This seems reasonable.

  • Status changed to Needs work 9 months ago
  • πŸ‡¦πŸ‡ΊAustralia acbramley

    Can we convert this to an MR and update test cases to include cacheability checking?

Production build 0.71.5 2024