-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
Stable image scales use weak instead of strong caching without plone.app.imaging #100
Comments
Oops, pressed Enter too quickly... Well, the above nicely illustrates the problem. Now let's see about an explanation. This tiny commit in plone.app.caching 1.2.0, used in Plone 5, is important, and you may want to read the comments. Previously, plone.app.caching had this:
So all scales were considered stable, and strongly cached.
Now all scales are considered unstable, and weakly cached. But when your instance has plone.app.imaging, this code is active:
So image scales that are marked as stable, get strong caching. The marking is done only for the uid scales, here in plone.namedfile. Where does this marker interface come from? That is in plone.namedfile.interfaces:
Now you may see what is missing:
Solution should be: in I will make a PR. |
When plone.app.imaging is available, this is already done. Otherwise, we should do this ourselves. Fixes #100.
Branch: refs/heads/master Date: 2021-07-09T16:22:29+02:00 Author: Maurits van Rees (mauritsvanrees) <[email protected]> Commit: plone/plone.namedfile@0b0cd85 Cache stable image scales strongly. When plone.app.imaging is available, this is already done. Otherwise, we should do this ourselves. Fixes plone/plone.namedfile#100. Files changed: A news/100.bugfix M plone/namedfile/scaling.zcml Repository: plone.namedfile Branch: refs/heads/master Date: 2021-07-11T11:10:17+02:00 Author: Jens W. Klein (jensens) <[email protected]> Commit: plone/plone.namedfile@8f92092 Merge pull request #101 from plone/maurits/stable-scales-stable-cache Cache stable image scales strongly. Files changed: A news/100.bugfix M plone/namedfile/scaling.zcml
Branch: refs/heads/master Date: 2021-07-09T16:22:29+02:00 Author: Maurits van Rees (mauritsvanrees) <[email protected]> Commit: plone/plone.namedfile@0b0cd85 Cache stable image scales strongly. When plone.app.imaging is available, this is already done. Otherwise, we should do this ourselves. Fixes plone/plone.namedfile#100. Files changed: A news/100.bugfix M plone/namedfile/scaling.zcml Repository: plone.namedfile Branch: refs/heads/master Date: 2021-07-11T11:10:17+02:00 Author: Jens W. Klein (jensens) <[email protected]> Commit: plone/plone.namedfile@8f92092 Merge pull request #101 from plone/maurits/stable-scales-stable-cache Cache stable image scales strongly. Files changed: A news/100.bugfix M plone/namedfile/scaling.zcml
This is a stable image scale with a unique id and can be strongly cached:
some-image/@@images/71292397-ba62-4ca0-a6d6-37707e151e35.jpeg
These are unstable image scales which may change when the image is edited, so should be weakly cached:
some-image/@@images/image
some-image/@@images/image/preview
What happens in various Plone versions?
plone.app.imaging
available: stable uid scales are strongly cached, others are weakly cached. Perfect!plone.app.imaging
available: all are weakly cached.We are only interested in fixing 5.2. Check it like this:
bin/instance-archetypes fg
soplone.app.imaging
is available.X-Cache-Operation: plone.app.caching.weakCaching
andX-Cache-Rule: plone.content.file
. For the stable uid scales you will seeX-Cache-Operation: plone.app.caching.strongCaching
andX-Cache-Rule: plone.stableResource
.bin/instance fg
.The text was updated successfully, but these errors were encountered: