[MGNLREST-300] Delivery endpoint serves cached results even after new content published Created: 15/Mar/21  Updated: 28/Nov/23

Status: Accepted
Project: Magnolia REST Framework
Component/s: None
Affects Version/s: 2.2.6
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Christopher Zimmermann Assignee: Unassigned
Resolution: Unresolved Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:
Epic Link: Headless Backlog
Team: DeveloperX

 Description   

Steps to reproduce

  1.  Create a content app and add content to it and publish content
  2.  Create delivery endpoint for that content
  3. Hit the endpoint to get some content
  4. Change some content in the app and publish it again.
  5. Make the exact same request to the delivery endpiont

.. Logs, screenshots, gifs...

Expected results

Endpoint returns newly published content

Justify non-trivial expectations with a link to a doc or a relevant discussion.

Actual results

Endpoint returns cached content

Workaround

Create cache config for that content app

or 

Append "cache busting" querystring to the request to endpoint so that the cache does not recognize it. 

Notes

As a developer I expect that the cache will not deliver stale content after a publish is made that affects that content.
It looks like for newly created content types/apps the publishing process does not trigger cache flush for respective workspace in public instances.
Pages (website workspace) works as expected.

Development notes

Also check that this is fixed for GraphQL endpoint.

 



 Comments   
Comment by Pierre Sandrin [ 27/Sep/22 ]

I stumbled on it and got scared. If true this would be a major Problem.

The flush Policy defined here should flush the cache if something changed in all workspaces (that are not excluded). Right?

/modules/cache/config/contentCaching/defaultPageCache/flushPolicy/policies/flushAll

I tested it on one of our Projekts that heavily relies on delivery endpoints but could not reproduce it. Is it still a Problem?

Comment by Christopher Zimmermann [ 28/Sep/22 ]

pierre  I think there must be a special case that I experienced, because I think it would have been widely reported if there was a common issue. Maybe it has to do with directly when a contentapp is created?

Generated at Mon Feb 12 06:58:33 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.