Opened 6 years ago

Last modified 5 years ago

#660 closed change

Switch to version 2 of the HTTP cache API — at Version 6

Reported by: trev Assignee: saroyanm
Priority: P2 Milestone: Adblock-Plus-2.6.4-for-Firefox
Module: Adblock-Plus-for-Firefox Keywords:
Cc: greiner, honzab, manvel@… Blocked By:
Blocking: Platform: Firefox
Ready: yes Confidential: no
Tester: Verified working: no
Review URL(s):

http://codereview.adblockplus.org/6241284884791296/
http://codereview.adblockplus.org/4875867805188096/

Description (last modified by trev)

Background

See http://www.janbambas.cz/http-cache-v1-api-disabled/, Mozilla is disabling version 1 of the HTTP cache API. We are currently using it in the blockable items list to determine whether we should show an image in the tooltip.

What to change

Switch to version 2 of the API, continue using version 1 as a fallback. Version 2 was enabled in https://bugzilla.mozilla.org/show_bug.cgi?id=913806, this one landed in Gecko 32. We will keep supporting older versions for a while still meaning that we need that fallback.

Change History (6)

comment:1 Changed 6 years ago by philll

  • Cc honzab added

comment:2 Changed 6 years ago by honzab

Some more info:

There is currently no simple way to detect the new cache is running, except a kinda hacky way, see [1]. Note that cacheIOTarget of the cache service version 1 will not throw when cache1 is off. The code at [1] can (should) be used to decide which of the two APIs to use.

Watch my blog [2] for more info on this. Next step is to remove cache1 code and interfaces altogether.

[1] http://hg.mozilla.org/mozilla-central/annotate/18c21532848a/netwerk/test/unit/head_cache2.js#l6
[2] http://www.janbambas.cz/tag/mozilla/

Last edited 6 years ago by honzab (previous) (diff)

comment:3 Changed 6 years ago by trev

  • Description modified (diff)

Thank you for the info. I was suspecting that HTTP cache v2 API wasn't usable immediately but I couldn't find the corresponding bug. So we can only drop the backwards compat code once we stop supporting anything below Gecko 32, good to know. Too bad that it has to happen in such a hacky way.

I guess we'll see your blog posts via Planet Mozilla, as before.

comment:4 Changed 6 years ago by honzab

I didn't want to expose any nsICacheStorageService.cacheVersion attributes. The hack works well tho.

And yes, posts will be on planet. There is also a bug on removal of the old cache code: https://bugzilla.mozilla.org/show_bug.cgi?id=913828

comment:5 Changed 6 years ago by saroyanm

  • Owner set to saroyanm

comment:6 Changed 6 years ago by saroyanm

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing
Note: See TracTickets for help on using tickets.