Gradually declining inline optimization

The hope

HTML enables inlining of images java-scripts and style-sheets inside web-pages, and inlining of css-images inside style-sheets.

This technique reduces the number of services (round-trips) that are required for loading and displaying a page.

The problem

Browsers can’t separately cache inlined resources. This causes bandwidth and performance problems:

  • When a page is updated, all its inlined resources must be retransmitted to the browser as part of the modified page.
  • Inlining JavaScripts and style-sheets that are shared between multiple pages, causes multiple transmissions of these resources.

Thus, only small resources (under 200 bytes) are usually inlined.

The solution

HtmlSpeed solves this problem by the gradually declining inline technique that we have developed. When a browser visits a web-page for the first time, HtmlSpeed performs an aggressive first-visit inlining. When the same browser revisits the same page
after the page has been modified, HtmlSpeed performs a less aggressive second-visit inlining. Inlining vanishes completely during the fourth visit to the same page.

When a browser moves from one page in the website to another page in the same website, HtmlSpeed performs second-visit inlining (which is less aggressive than first-visit inlining). The reason for that is that the shared JavaScripts and style-sheets
were probably cached by the browser while visiting previous pages.

The gradually declining inline technique enables HtmlSpeed to dramatically reduce the number of services that are needed for loading a page without wasting bandwidth.