Add support for varnish purging based on expressions

Previously we would only purge based on URLs, but some of the upcoming
new work requires arbitrary expression purging.

NOTE! Require the creation of the new SQL procecure in the database,
either from varnish.sql or varnish_local.sql depending on if it's prod
or dev.
This commit is contained in:
Magnus Hagander
2012-10-03 12:45:06 +02:00
parent aa0fc310ac
commit 33ed40343b
4 changed files with 27 additions and 5 deletions

View File

@ -190,7 +190,7 @@ def admin_purge(request):
# Fetch list of latest purges
curs = connection.cursor()
curs.execute("SELECT ev_time, ev_data FROM pgq.event_1 WHERE ev_type='P' ORDER BY ev_time DESC LIMIT 20")
curs.execute("SELECT ev_time, ev_data FROM pgq.event_1 WHERE ev_type IN ('P', 'X') ORDER BY ev_time DESC LIMIT 20")
latest = [{'t': r[0], 'u': r[1]} for r in curs.fetchall()]
return render_to_response('core/admin_purge.html', {