Our self-developed ultra-fast html and style-sheet parsers, enable HtmlSpeed to optimize each and every html or style-sheet document before returning it to the browser.
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.
Content-first optimization
The problem
Many pages contain JavaScripts that must be loaded and executed before the text and images that are contained in the page can be displayed. This can delay rendering for a
few seconds. Trying to bypass this problem by moving java-scripts to the end of the page is likely to introduce bugs, and thus is not recommended.
The solution
HtmlSpeed solves this problem by using the content-first optimization technique that we have developed. First an iframe occupying the entire window is displayed above the
page. The iframe displays the page in a mode in which all JavaScripts are skipped, to allow the content of the page to be immediately rendered. Meanwhile bellow the iframe, the entire page is parsed and rendered and its JavaScripts are executed. When the browser finishes parsing the page, the iframe is removed and the full page is revealed.
The effect of the content-first optimization is a much faster page loading and improved user experience.
Cost effective CDN usage
The problem
Using a CDN for loading static files is a great geo-based optimization. But this can cost much, because you pay by consumed bandwidth.
The solution
HtmlSpeed solves this problem by assigning file-size ranges to one or more CDN providers (such as MaxCDN, CDN77, CloudFlare, …). For each static-file HtmlSpeed selects the CDN to be used for serving the file based on the file size. When no CDN is selected, the file is directly served by the original website. This increases the speed of serving many small static-files, like small style-sheet background images and small JavaScripts, without paying too much to CDN providers.
When using a CDN, HtmlSpeed supports shared SSL (enables secured access to resources that are passed through the CDN using a secured domain supplied by the CDN provider). HtmlSpeed also supports custom SSL (enables secured access to these resources using your certificate which is uploaded to the trusted CDN).
Not modified optimization
The problem
Most websites generate customized web pages. When the browser is requested to redisplay a page, the page must be reloaded from the server even when its content hasn’t changed.
The solution
HtmlSpeed solves this problem by using a technique for detecting if the customized web-page that is kept by the browser has changed, and if not HtmlSpeed
returns not-modified status to the browser.
Versioning
The problem
Some websites assign small max-age values (or near expiration times) to state-less resources (for example 10 minute expiration-time). Thus, browsers are allowed to cache these resources for short time periods.
The solution
HtmlSpeed extends the max-age property of these resources by auto’ versioning their file-names (appending version-codes to the file-names). HtmlSpeed sets the max-age property of these versioned resources to be one year. When the content of any versioned resource is modified, its file-name is also modified (the version-code suffix is replaced).