just added this adapter to my package. should we add the same to plone.app.event?
from z3c.caching.interfaces import IPurgePaths
class EventOccurrencesPurgePaths(object):
"""purges urls for event occurrences
"""
implements(IPurgePaths)
adapts(IMyEvent)
def __init__(self, context):
self.context = context
def getRelativePaths(self):
prefix = self.context.absolute_url_path()
result = []
for occ in IRecurrenceSupport(self.context).occurrences():
if occ.portal_type == 'Occurrence':
result.append(prefix + '/' + occ.id)
return result
def getAbsolutePaths(self):
return []
side note: first i tried to purge with a regex/glob character (eg <event-id>[\d-]*). but looks like this is what BANs are for in varnish (https://varnish-cache.org/docs/4.1/users-guide/purging.html). however, it looks like plone.cachepurging only issues PURGE requests only by default so the exact urls are needed.
just added this adapter to my package. should we add the same to plone.app.event?
side note: first i tried to purge with a regex/glob character (eg
<event-id>[\d-]*
). but looks like this is what BANs are for in varnish (https://varnish-cache.org/docs/4.1/users-guide/purging.html). however, it looks like plone.cachepurging only issues PURGE requests only by default so the exact urls are needed.