ML archives caching 404 results

From: Marti Raudsepp <marti(at)juffo(dot)org>
To: pgsql-www <pgsql-www(at)postgresql(dot)org>
Subject: ML archives caching 404 results
Date: 2014-10-07 13:52:01
Message-ID: CABRT9RCmobXxGxDyh8YVkQHg3Yi39NQuDfsg57MXCcMgm4tyDg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-www

Hi www,

When adding my messages to CommitFest, I noticed that when I'm fast enough
to click on the resulting link, I get a 404 page from mailing list
archives, I guess if archives loader hasn't processed my message yet. This
404 result gets cached for a long time, so my message is not viewable even
after links to it appear in archives.

It's not obvious to me why this happens... The view raises an exception,
and the cache() decorator should never get around to setting HTTP cache
headers because it lets the exception pass through.

@cache(hours=4)
def message(request, msgid):
try:
m = Message.objects.get(messageid=msgid)
except Message.DoesNotExist:
raise Http404('Message does not exist')

Is there a default expiration time set in Varnish somewhere? Maybe the
solution is as easy as setting a lower TTL for 404 results in Varnish:
http://www.garron.me/en/bits/avoid-varnish-cache-404-error-page.html

Another solution would be to somehow shoehorn a cache key into 404 result
pages, but that smells of hack, since we'd need a different identifier from
the usual "X-pgthreadid".

Regards,
Marti

Responses

Browse pgsql-www by date

  From Date Subject
Next Message Magnus Hagander 2014-10-07 13:57:07 Re: ML archives caching 404 results
Previous Message Marti Raudsepp 2014-10-06 15:03:20 [PATCH] Fix colspan of commitfest topic headers