Closed Bug 939729 Opened 7 years ago Closed 7 years ago

With httpd.js we sometimes don't get the most recent version of the file

Categories

(Firefox OS Graveyard :: Gaia, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: julienw, Assigned: julienw)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

STR:
* open http://sms.gaiamobile.org:8080 in a DEBUG=1 DESKTOP=0 profile
* change things in apps/sms/js/desktop-only/contacts.js
* reload the page in Firefox

Expected:
* the changes are loaded

Actual:
* no changes are visible

These files are lazy loaded and even when shift-reloading Firefox don't try to get an updated version.
Attached patch patch v1 (obsolete) — Splinter Review
see also PR at https://github.com/mozilla-b2g/gaia/pull/13793
(we want a green Travis obviously)

This patch:
* makes all files expire immediately, forcing a revalidation by Firefox
* implements conditional requests with Last-Modified-Since
---
 tools/extensions/httpd/content/httpd.js |   26 ++++++++++++++++++++++----
 1 file changed, 22 insertions(+), 4 deletions(-)
Attachment #8333769 - Flags: review?(21)
This patch will probably also make it possible to remove the horrible workaround in the test-agent, where all requests go with a "?time=" parameter to force getting a new file.
Attached patch patch v2Splinter Review
Sorry, I left a bad comment in my previous patch. Here's a new patch with a more interesting comment.

PR is updated at https://github.com/mozilla-b2g/gaia/pull/13793
Attachment #8333769 - Attachment is obsolete: true
Attachment #8333769 - Flags: review?(21)
Attachment #8333771 - Flags: review?(21)
Comment on attachment 8333771 [details] [diff] [review]
patch v2

Review of attachment 8333771 [details] [diff] [review]:
-----------------------------------------------------------------

::: tools/extensions/httpd/content/httpd.js
@@ +2813,5 @@
> +
> +      if (lastModified && ifModifiedSince && lastModified === ifModifiedSince) {
> +        dumpn(">>> file was not modified, returning a 304 code");
> +        response.setStatusLine("1.1", 304);
> +        return;

Those sounds good to me but maybe you also want to upstream those changes? http://mxr.mozilla.org/mozilla-central/find?text=&string=httpd.js
Attachment #8333771 - Flags: review?(21) → review+
Blocks: 939755
master: 2b0662ecb0e52e7b53ba80566cc1cacf442f8e57

Bug 939755 was opened to upstream this.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Blocks: 973873
You need to log in before you can comment on or make changes to this bug.