Skip to content

· 2 min read

Faster pages: HQAPI now uses a CDN

The scripts, styles and images of hqapi.com now come from a CDN, and the script every page loads is about 70% smaller.

hqapi.com now loads its scripts, styles and images from a content delivery network (CDN), so they come from a server close to you instead of from our own. Pages open sooner, wherever you are.

What changed

All static files are now served from files.hqapi.com, a separate host that keeps copies of our files in many locations around the world. A file is fetched from the location nearest to you, and your browser keeps it afterwards. The files that make up a release have a fingerprint in their name, so we can tell your browser to keep them for a full year: on your next visit nothing has to be downloaded again, and when we release something new the name changes and you get the new version at once.

Less to download

While we were at it we looked at what every page really needs:

  • The script that every page loads went from 334 KB to about 101 KB. The chart library and the code highlighter, which only a few pages use, are now loaded only on those pages.
  • The main screenshot on the home page went from 472 KB to 160 KB.
  • Logos at the bottom of a page load only when you scroll to them.

What did not change

The API itself is not served through the CDN: your API calls go to the same places as before, and the time a screenshot takes depends on the page being captured, not on this change. Nothing changes in how you use the service, and your API token and your data are not involved: the CDN only ever handles our public, static files.

A safe setup

The CDN host serves only static files. Everything else on it is redirected to hqapi.com, and the whole site, including the CDN host, is HTTPS only.

You can see the difference on any page of the site, for example the pricing page or the Screenshot API documentation. Questions? Get in touch.

← All news