Closed Bug 1034728 Opened 8 years ago Closed 7 years ago

Apps using AppCache aren't cached if the AppCache is already cached in Firefox

Categories

(Core :: Networking: Cache, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla39
Tracking Status
firefox39 --- fixed

People

(Reporter: marco, Assigned: mayhemer)

Details

Attachments

(1 file)

Installing an app that uses AppCache should download the cache in the app's profile directory.
This is not happening for apps that use an AppCache that is already downloaded in Firefox.

I guess we're checking if the AppCache is already downloaded in general and we're not making the distinction between "already downloaded in the current profile" and "already downloaded in the target profile".

The function that takes care of downloading the AppCache for apps is |nsIOfflineCacheUpdate::scheduleAppUpdate|, the last parameter is the target profile.

Easily reproducible with this app: http://nell-balloons.github.cscott.net/
(In reply to Marco Castelluccio [:marco] from comment #0)
> The function that takes care of downloading the AppCache for apps is
> |nsIOfflineCacheUpdate::scheduleAppUpdate|, the last parameter is the target
> profile.

Exactly, and the update that is scheduled creates always a new app cache in the target directory:

http://hg.mozilla.org/mozilla-central/annotate/fc35681b0a87/uriloader/prefetch/nsOfflineCacheUpdate.cpp#l1249

I'll try to reproduce tho.
Assignee: nobody → honzab.moz
Attached patch v1Splinter Review
Cause:
- offline cache update channels are set LOAD_CHECK_OFFLINE_CACHE flag
- this makes them look into appcache even they are not set "previous appcache" to check on
- custom profile appcache loads (=an installable app) are not set the previous cache (correctly)
- but the flag makes them do the default browser profile appcache lookup => we check the manifest, it's not changed => no update, no download, no love

We can freely remove the flag, since if there is a cache to use as a normal cache for the load it's set manually on the channel: http://hg.mozilla.org/mozilla-central/annotate/6608e0605dfc/uriloader/prefetch/nsOfflineCacheUpdate.cpp#l393

https://treeherder.mozilla.org/#/jobs?repo=try&revision=5d8ca498ef2f
Attachment #8569259 - Flags: review?(jduell.mcbugs)
Status: NEW → ASSIGNED
Attachment #8569259 - Flags: review?(jduell.mcbugs) → review+
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/010198e03e66
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
You need to log in before you can comment on or make changes to this bug.