Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Donut caching breaks functions using C1PageRoute.RegisterPathInfoUsage(); #823

Open
napernik opened this issue Mar 29, 2023 · 0 comments
Open
Assignees
Labels

Comments

@napernik
Copy link
Member

napernik commented Mar 29, 2023

  1. Use Composite.News package
  2. In a layout, have one function that has PreventFunctionOutputCaching set to true
public override bool PreventFunctionOutputCaching { get { return true; } }
  1. Add a news page
  2. Visit the news page in incognito mode, (so there's no logged in user and the caching isn't disabled)
  3. Refresh the page a few times

Expected:

The page is shown

Actual:

The page is shown only on the first visit, and 404 response is shown afterwards

Explanation:

Donut caching feature caches the output of the Composite.News.NewsList function, but doesn't caches the fact that C1PageRoute.RegisterPathInfoUsage(); should be invoked as well.

Workaround:

Add the following line to the affected function:

public override bool PreventFunctionOutputCaching { get { return true; } }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants