Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Purge urls starting with resource url and not only exact resource url

  • Loading branch information...
commit a87c4387068f4190323f42581cbd957e55b562cd 1 parent 9abe681
Anders Eriksen authored
Showing with 7 additions and 1 deletion.
  1. +7 −1 varnishapp/signals.py
8 varnishapp/signals.py
View
@@ -28,6 +28,12 @@ def purge_old_paths(abs_url):
logger.warn('No varnish instance running. Could not purge %s' % str(p.old_path))
def absolute_url_purge_handler(sender, **kwargs):
+ """
+ Purges the absolute url of the model instance
+ NB: It adds $ to the end of the purge, so no urls with parameters etc are purged,
+ only the url given by get_absolute_url itself
+ """
+
abs_url = kwargs['instance'].get_absolute_url()
try:
@@ -64,7 +70,7 @@ def get_resource_url(self):
resource_url = instance.get_resource_url()
try:
- manager.run('purge.url', r'^%s$' % resource_url)
+ manager.run('purge.url', r'^%s' % resource_url)
except:
logger.warn('No varnish instance running. Could not purge %s ' % resource_url)
Please sign in to comment.
Something went wrong with that request. Please try again.