Whenever a user replaces/updates the image attached to a news item, then the news item view and folder listing above is purged (updated) on the varnish cache – but the attached image itself is not.
How can I make plone.app.caching to also purge/update not only <mysite>/news/
and <mysite>/news/news-item/
but also the images under <mysite>/news/news-item/image_news_scale
and <mysite>/news/news-item/image_even_smaller_news_scale
?
Background: Using Plone 4.3.2 I setup my a own custom image scales, e.g. news_scale
via <mysite>/@@imaging-controlpanel
. This scale is used for displaying the attached images in news items, e.g. as <mysite>/news/news-item/image_news_scale
. Moreover, I also have another custom image scale like even_smaller_news_scale
to be used in folder listings, e.g. as <mysite>/news/news-item/image_even_smaller_news_scale
. I created these views via <mysite>/portal_skins/custom
and registered them as default views under <mysite>/portal_types/
and select_default_view
action.
PS I just saw now, because I am using raptus.multilanguageplone, the images' URL are available even under a more complicated URL that is dependent upon selected language: <mysite>/news/news-item/image___de____news_scale
and <mysite>/news/news-item/image___de____even_smaller_news_scale
(de
could also be en
depending on language)
if you already configured cache purging in plone.app.caching correctly you'll notice that newsitem/image_thumb and other image sizes will get purged correctly by default.
plone.app.caching does not know about the custom urls for the images because of raptus.linguaplone. so you'll have to create your own adapter that implements
IPurgePaths
for your newsitemssomething like this should do the trick:
see also https://pypi.python.org/pypi/plone.cachepurging