A Faster FasterFox? David Backeberg and Remo Mueller.

19
A Faster FasterFox? David Backeberg and Remo Mueller

Transcript of A Faster FasterFox? David Backeberg and Remo Mueller.

Page 1: A Faster FasterFox? David Backeberg and Remo Mueller.

A Faster FasterFox?

David Backeberg

and

Remo Mueller

Page 2: A Faster FasterFox? David Backeberg and Remo Mueller.

Firefox “Out of the Box”

• Memory cache set proportional to system ram

• Disk cache set to default value (76,800 KiB)

• “Prefetching” enabled: network.prefetch-next set to true

Page 3: A Faster FasterFox? David Backeberg and Remo Mueller.

Browser content caching

• HTTP/1.1 200 OK Date: Fri, 30 Oct 1998 13:19:41 GMT Server: Apache/1.3.3 (Unix) Cache-Control: max-age=3600, must-revalidate Expires: Fri, 30 Oct 1998 14:19:41 GMT Last-Modified: Mon, 29 Jun 1998 02:28:12 GMT Content-Length: 1040 Content-Type: text/html

• HTML also supports tags involving caching. Not necessarily honored by browsers.

• <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">

Page 4: A Faster FasterFox? David Backeberg and Remo Mueller.

Everyone wins

• Browser doesn’t have to grab something it already has

• Server / client don’t waste bandwidth on redundant content

• User thinks website is “faster”, more likely to make return visits to website

Page 5: A Faster FasterFox? David Backeberg and Remo Mueller.

Firefox Extensions(.xpi)

• Third-party applications that use Firefox library functions to accomplish some task

• Examples– Forecastfox (weather info on toolbar)– Flashgot (replaces Firefox download ability

with richer functions)

Page 6: A Faster FasterFox? David Backeberg and Remo Mueller.

Firefox prefetching

• Firefox extends HTML link tag• <link rel="prefetch" href="mozspecific.css">

<link rel="next" href="2.html">

• This method isn’t forbidden, it merely creates a new kind of “relation”, permitted by HTTP 1.1

• If “rel” is “prefetch” or “next”, Firefox will prefetch the page(s)

Page 7: A Faster FasterFox? David Backeberg and Remo Mueller.

Firefox Prefetching

• Prefetching only uses “idle” bandwidth• We put “idle” in quotes because the

browser can’t tell what else is going on with network activity in other system applications or daemons

• Once all tabs or pages are loaded, Mozilla will grab explicitly tagged content

Page 8: A Faster FasterFox? David Backeberg and Remo Mueller.

Firefox Prefetching

• Prefetched content ends up in disk-cache.

• Prefetching makes the cache more relevant, and “fresher” than it would be without prefetching

• User has illusion of faster browsing

Page 9: A Faster FasterFox? David Backeberg and Remo Mueller.

Firefox settings

• Settings can be viewed and changed with about:config

• These settings can also be changed with prefs.js in user’s directory

• Cache contents and settings can be viewed with about:cache

Page 10: A Faster FasterFox? David Backeberg and Remo Mueller.

Firefox internals

• Individual functions (library calls) within Firefox can be put into debug mode

• Under linux:$export NSPR_LOG_MODULES=nsHttp:5,nsSocketTransport:5,nsHostResolver:5, nsPrefetch:5$export NSPR_LOG_FILE=/home/dave/eecs428/fasterfox/http.log$firefox

• In this manner we could get a log of whether prefetching was working

• Examined cache using about:cache• Recorded page load times

Page 11: A Faster FasterFox? David Backeberg and Remo Mueller.

Fasterfox

• An .xpi-based extension of Firefox

• Uses Firefox library calls to provide richer prefetching and caching abilities

• Also “tweaks” page rendering techniques to display content faster

• Tunable “aggressiveness”

Page 12: A Faster FasterFox? David Backeberg and Remo Mueller.

Fasterfox Settings• Some settings are just

user-friendly GUIs for changing settings buried in about:config

Page 13: A Faster FasterFox? David Backeberg and Remo Mueller.

Fasterfox Settings• Other settings are

genuine extensions of the way Firefox downloads pages

Page 14: A Faster FasterFox? David Backeberg and Remo Mueller.

Enhanced Prefetching

• Doesn’t restrict prefetching to rel=next, rel=prefetch links

• Index up to 100 links on a page, prefetch all of those, as long as they look like static content

• Try not to prefetch a “logout” or “empty my shopping cart” button

Page 15: A Faster FasterFox? David Backeberg and Remo Mueller.

Enhanced Prefetching

• Very good odds of user clicking a cached page, and that cached version being up-to-date

• Also good odds of cache containing data that won’t be viewed by user

• Arguably, for a site the user visits heavily, this could still mean everybody wins

Page 16: A Faster FasterFox? David Backeberg and Remo Mueller.

How We've Modified Fasterfox:

• Fasterfox now keeps track of how long it took to visit each page. After running a test series, we can gather all the information and perform an analysis of it.

• We also changed the content that is grabbed in Fasterfox

Page 17: A Faster FasterFox? David Backeberg and Remo Mueller.

Timings screenshot

Page 18: A Faster FasterFox? David Backeberg and Remo Mueller.

How to Enhance Fasterfox

• Prioritized Prefetching (Fasterfox currently uses a fifo queue, ordered by the link’s location on a page)

• Global System view of bandwidth; prefetch only when system idle?

• Gentler prefetching mechanism? Prefetching uses ordinary HTTP GET. Perhaps a PREGET?

• User Customization– Different user types– User selects, or artificial intelligence to figure out what type

the user is.• Cache hit rate percentage (prove that prefetching is

really making the cache more relevant)

Page 19: A Faster FasterFox? David Backeberg and Remo Mueller.

References:

• Firefox Link Prefetching FAQhttp://www.mozilla.org/projects/netlib/Link_Prefetching_FAQ.html

• Fasterfox source codehttp://fasterfox.mozdev.org/

• Mozilla HTTP Debugging guidehttp://www.mozilla.org/projects/netlib/http/http-debugging.html

• Assertion: Prefetching With GET Is Not Good, Brian Davison. Proceedings of the Sixth International Web Content Caching and Content Distribution Workshop (WCW'01), Boston, June 20-22, 2001, pages 203-215. Available online: http://www.cse.lehigh.edu/~brian/pubs/2001/wcw/wcw01.pdf