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

PicklingError for SampleStreamBlockMeta #34

Open
vladox opened this issue Nov 26, 2021 · 2 comments
Open

PicklingError for SampleStreamBlockMeta #34

vladox opened this issue Nov 26, 2021 · 2 comments

Comments

@vladox
Copy link

vladox commented Nov 26, 2021

We are getting the following error, is it a known issue?

_pickle.PicklingError: Can't pickle <class 'wagtail.core.blocks.base.SampleStreamBlockMeta'>: attribute lookup SampleStreamBlockMeta on wagtail.core.blocks.base failed

@vladox
Copy link
Author

vladox commented Nov 27, 2021

How do you avoid caching in the Wagtail API? The issue is with an APIView, but I couldn't find a way for the middleware to ignore the API Calls.

@vsalvino
Copy link
Contributor

vsalvino commented Nov 29, 2021

Good question. For the pickling error, what version of Wagtail and Django are you using?

As far as not caching the API, you'll need to disable the middleware, and either:

  • warp the specific URL routes in the cache_page decorator.
  • Or decorate the specific page models you want cached.

See this section in the docs: https://docs.coderedcorp.com/wagtail-cache/getting_started/install.html#only-cache-specific-views

Let me know if either of those approaches helps.

Hint while debugging: the HTTP Response contains an X-Wagtail-Cache header which indicates: skip, miss, or hit. If it is not present in the response then the URL is not even being touched by wagtail-cache.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants