Adblock Plus and (a little) more

Simplifying subscription downloads module [Done] · 2013-02-04 08:18 by Wladimir Palant

Done, this proposal has been implemented as of 2013-07-08.

The module responsible for updating subscriptions is one of the most complicated components of Adblock Plus, also one that is notoriously complicated to test properly. Much of the code here is outdated for one reason or another.

Current state

  • Some parameters can be specified as HTTP headers, others as special comments, sometimes both. The HTTP headers are hard to add and seem to be unreliable, they don’t always make it to the client.
  • The format of the special comments is inconsistent, with the update interval comment being a special case. Documentation is also inconsistent and in some cases simply non-existent.
  • Some of the parameters have been proven as not useful.
  • Default update interval is daily which isn’t a good default.
  • Specifying update intervals below a day isn’t possible.

Goals

  • Remove the unnecessary complexity.
  • Get rid of inconsistencies and unreliable approaches.

Proposal

  • Last-Modified header should no longer be handled, it isn’t effective to reduce traffic.
  • X-Alternative-Locations header should no longer be handled (this is subject to another proposal).
  • The Expires HTTP header should no longer be handled. Update interval should be specified via comment only, standard format like ! Expires: 2 days should be required. The default update interval should be five days and the lowest possible update interval should be one hour.
  • HTTP redirects should no longer get any special handling, handling of the special Redirect comment should be improved instead. In case of a Redirect comment pointing to a different location Adblock Plus should ignore the filters and try downloading from the new address immediately rather than waiting several days. If the download succeeds after no more than 5 redirects then the address of the filter subscription should be changed.
  • Drop support for parameters in the subscription address (currently only Adblock Plus version), this was never documented and isn’t used anywhere.
  • The special comments should be documented in the filters guide where subscription authors will see them, not in the FAQ any more.
  • The actual download logic should be refactored into a separate module so that it can be reused by URL Fixer / typo correction feature.

Tags:

Comment [1]

  1. Lain_13 · 2013-02-04 12:27 · #

    Is it possible to keep HTTP redirect support? I’m using shortened links to subscription files instead of full path on forum.mozilla-russia.org in my signature due to signature length limit.

    Reply from Wladimir Palant:

    If you put “! Redirect: https://the_real_address” into the subscription it should have the same effect, just more reliable. At least once these changes are implemented, right now it doesn't quite work that way.

    Reply from Wladimir Palant:

    Ok, I think I see now why you are asking – the original formulation was confusing indeed. I changed it into “HTTP redirects should no longer get any special handling” – the usual handling for HTTP redirects (follow them) will still be there of course, we merely won’t change the subscription address if we see permanent redirects.

Commenting is closed for this article.