There are two methods of integrating Dexecure with custom built websites. In this article, we will look at integrating Dexecure via the Service Worker method.
Integrating Dexecure this way is as simple as uploading a script to your server and calling it in your pages.
Let's optimize assets being served from example.com
Getting your Dexecure Installation Script
- Login to Dexecure Dashboard and create a Dexecure domain at https://app.dexecure.com/dashboard.
- Add your domain you want to optimize
- Next, click on the Install Dexecure button, choose the domain you just added and click on Next.
- Click on "If your website uses something else Click Here"
- Click on "Try the service worker method"
- Now, download the file you would need to host on your website and host it at the root of your website like https://example.com/xxx-dexecure.js
- We now need to call this script in your HTML pages. In the same screen, you would see the installation code that you would need to insert into your webpages.
Now all assets going through Dexecure would automatically be optimized based on the browser, device, network, screen resolution, etc. automatically!