Skip to content

Ask UW CSE IT to let /media/talks/ and /media/posters/ 404s fall through to Django #1431

Description

@jonfroehlich

The gap

/media/publications/ is proxied to Django, so a request for a renamed or mistyped publication PDF reaches serve_pdf, which resolves it three ways (exact match → original_pdf_filename → difflib fuzzy match) and redirects. /media/talks/ and /media/posters/ are not — Apache serves those files directly and answers a miss itself.

Verified against prod (2.28.0):

$ curl -s -o /dev/null -w '%{http_code}\n' .../media/publications/DefinitelyNotReal.pdf
404   # Django: the Makeability Lab custom 404 page (text/html; charset=utf-8)

$ curl -s .../media/talks/DefinitelyNotReal.pdf | head -3
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">   # Apache's default error page (iso-8859-1)

Why it matters

Talk and poster files get renamed whenever their metadata changes (Artifact.save()), and #1404 renamed the existing corpus once to add the _Talk / _Poster segment. Every one of those renames dead-ends any external or Google-indexed link to the old URL, with no in-repo remedy — publications have a safety net, talks and posters have none.

The ask

Have Apache fall through to Django on a 404 under /media/talks/ and /media/posters/ (the same treatment /media/publications/ already gets), or proxy those paths outright. Related: #1173 left a note to narrow the /media/publications/ proxy to *.pdf only, which could be handled in the same conversation.

What we'd do with it

Add a talks/posters analogue of serve_pdf. No data capture is needed first — the pre-#1404 name is still derivable from metadata (Artifact.generate_filename(artifact, include_type_suffix=False)), and never-renamed originals are already recorded in original_pdf_filename / original_raw_filename from #1391. So the redirect can be built entirely from what's already in the DB, the day the path reaches Django.

Spun out of #1404.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions