Closed
Description
Recently came across this: When the internal CMS-cache-key for placeholders has a length of 249, an InvalidCacheKey
error is raised.
I used memcached
for the backend.
Reason:
- CMS hashed
length > 250
: cms.cache.placeholder.py#L130 - django adds "version" itself: django.core.cache.backends.base.py#L119
- this will be called through
cache.set(..)
So if the key is 249 characters long, the cms-hashing won't be called (due to if len(cache_key) > 250
) and django
adds :1
(or sth like that) which results in > 250
characters leading to InvalidCacheKey
-error.
Even if you would set cache.set(key, value, version="")
, django would still add :
to it which results in same error when the "plain cms-cache-key" is exactly 250 characters long.
Additional information (CMS/Python/Django versions)
- cms: 3.11.1
- django: 3.2.18
- python: 3.11
Do you want to help fix this issue?
- Yes, I want to help fix this issue and I will join #workgroup-pr-review on Slack to confirm with the community that a PR is welcome.
- No, I only want to report the issue.