Wrong Last-Modified header for module page with recent dev release #564

Closed
dolmen opened this Issue Apr 30, 2012 · 2 comments

Comments

Projects
None yet
2 participants
Contributor

dolmen commented Apr 30, 2012

It looks like the /module/xxx page has a Last-Modified header that is computed based on the timestamp of the latest stable release.
This is wrong if the module has a newer dev release:

This lead to strange behavior because the client browser (Firefox) will keep the old page forever. Even a refresh (F5 in Firefox) is temporary, because as the header says the newly downloaded page is the same, Firefox will not replace it on disk. Closing and reopening the browser on that page shows again the old one.

Example case: https://metacpan.org/module/Module::CPANTS::Analyse

$ curl -s -I https://metacpan.org/module/Module::CPANTS::Analyse | grep Last-Modified
Last-Modified: Sat, 11 Jul 2009 22:01:54 GMT

But that page lists a DEV release on 2011-04-12:

$ curl -s https://metacpan.org/module/Module::CPANTS::Analyse | grep '0\.86'
<option value="DAXIM/Module-CPANTS-Analyse-0.86-TRIAL-2/lib/Module/CPANTS/Analyse.pm">0.86 DEV (2012-04-10)</option>
<option value="DAXIM/Module-CPANTS-Analyse-0.86-TRIAL-2/lib/Module/CPANTS/Analyse.pm">0.86 DEV (2012-04-10)</option>
Contributor

dolmen commented May 3, 2012

In MetaCPAN::Web::Controller::Module line 86 the last_modified header should be set to the date of the latest release (because the page displays ReleaseInfo data) instead of the current one.

@oalders oalders closed this in 1182eea May 4, 2012

Owner

oalders commented May 4, 2012

Thanks very much for troubleshooting this!

[~] $ curl -s -I https://metacpan.org/module/Module::CPANTS::Analyse | grep Last-Modified
Last-Modified: Tue, 10 Apr 2012 23:52:04 GMT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment