Page MenuHomePhabricator

Make UrlShortener 404s cacheable
Closed, ResolvedPublic

Description

After discussion with @BBlack, it would be good if we cache the 404s the extension emits for fifteen minutes.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 501541 had a related patch set uploaded (by Ladsgroup; owner: Ladsgroup):
[mediawiki/extensions/UrlShortener@master] Cache invalid redirects as well

https://gerrit.wikimedia.org/r/501541

ema triaged this task as Medium priority.Apr 8 2019, 11:34 AM

Change 501541 merged by jenkins-bot:
[mediawiki/extensions/UrlShortener@master] Cache invalid redirects as well

https://gerrit.wikimedia.org/r/501541

Should we have a CDN purge when we create new short codes just in case the 404 was cached?

+1 for purging after creation.

Varnish is configured to cache 4xx errors for a short time (5 minutes, I think), and the above patch extends this to 15 minutes. Longer is probably not needed for errors. Purging would still be great though, for responsiveness in case of the error being cached prior to creation. But, worst case scenario (such as purges being lost, which does happen), it'll self-correct soon enough.

Change 512516 had a related patch set uploaded (by Legoktm; owner: Legoktm):
[mediawiki/extensions/UrlShortener@master] Purge CDN after creating a new shortcode

https://gerrit.wikimedia.org/r/512516

Change 512516 merged by jenkins-bot:
[mediawiki/extensions/UrlShortener@master] Purge CDN after creating a new shortcode

https://gerrit.wikimedia.org/r/512516