Merge lp:~rharding/convoy/add_listmod_header into lp:convoy
Status: | Needs review |
---|---|
Proposed branch: | lp:~rharding/convoy/add_listmod_header |
Merge into: | lp:convoy |
Diff against target: |
304 lines (+140/-32) 2 files modified
convoy/combo.py (+34/-9) convoy/tests/test_combo.py (+106/-23) |
To merge this branch: | bzr merge lp:~rharding/convoy/add_listmod_header |
Related bugs: |
Commit message
Add a last-modified header to the response so browsers/web servers can help prevent sending unchanged files.
Description of the change
= Summary =
Convoy should return a last-modified header to help allow browsers in sending 304 responses to the same combo files already stored.
== Proposed Fix ==
Track the mtime of the files as we process them and return that as a Last-Modified header in the response.
== Implementation Details ==
This was a bit intrusive. Since the response is really just the looping through the files I had to pull out the list of files in order to find the latest mtime. This means we add an additional loop of the files to the overall process.
The tests then had to be updated since the combine_files now expexts full paths vs the partials. Each of the tests either had to update the file paths themself, or I just used the new build_filelist to do it.
== Tests ==
- Updated the tests to call build_filelist
- Added the Last-Modified to the header checks
- Added a check to verify the Last-Header is correct.
Unmerged revisions
- 22. By Richard Harding
-
Garden
- 21. By Richard Harding
-
Update convoy to supply a last-modified header
Personally I wouldn't send a last-mod, if you send a hash of the
content of the files - a strong validator - browsers will send an
if-none-match conditional, and you *won't* have to deal with the
fallout of fs datestamp skew (which would cause headache for LP, for
instance).
-Rob