Speed Kit: Intro

In this section, we describe how to speed up your website with Baqend Speed Kit with 5 easy steps. For a more high-level introduction, see our overview section.

Watch this short video to learn how Speed Kit can help you make fast page loads your competitive advantage:

  1. Configure Speed Kit

    In your account simply enter your site's URL as well as all whitelisted and blacklisted domains, respectively. All requests to whitelisted domains are rerouted to Baqend while requests to blacklisted domains will not be speeded up. A common example of blacklisted domains are those of tracking or ad services.

  2. Integrate code snippet

    Insert the generated code snipped into the header of your index.html. This snipped registers the service worker that will speed up your requests.

  3. Download Service Worker

    Download the latest Service Worker script from baqend.

  4. Host Service Worker

    In order to provide the Service Worker with its full functionality, it needs to have the root scope. Thus, the Service Worker should be hosted in your root directory. If you are able to do so, the default case is yours. If for whatever reason this is not possible, we provide you some implementation options here:

    WordPress

    Use our WordPress Plugin.

    Apache

    Option 1: Rewrite the request url for the service worker to the actual location:

    # Add the following lines to your httpd.conf file
    # replace <location> with the actual location of the service worker
    RewriteEngine On
    RewriteRule ^/sw.js$ <location>
    

    Option 2: Customize the service workers registration path by still giving it root scope

    # Add the following lines to your httpd.conf file
    <Files "sw.js">
    Header Set Service-Worker-allowed "/"
    </Files>
    # Find this line in your code snipped: "navigator.serviceWorker.register('sw.js')"
    # and change it like this:
    navigator.serviceWorker.register(<enter your service worker path>, {scope: '/'})
    

    Nginx

    Option 1: Rewrite the request url for the service worker to the actual location:

    # Add the following lines to the suitable server or location block in your nginx.conf file
    # replace <location> with your actual service worker location
    rewrite ^(/sw.js)$ <location> last;
    

    Option 2: Customize the service workers registration path by still giving it root scope

    # Add the following lines to your httpd.conf file
    # and replace <location> with your service worker location
    location  = /<location> {
    add_header 'service-worker-allowed' '/';
    }
    # Find this line in your code snipped: "navigator.serviceWorker.register('sw.js')"
    # and change it like this:
    navigator.serviceWorker.register(<enter your service worker path>, {scope: '/'})
    

  5. Enjoy Performance

    Speed Kit will automatically make your website faster.

Proceed to next Chapter: Why Speed Kit