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. Contact us if you need help with this.
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
Using the Dexecure domain, generate the service worker script from this Github repo.
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. Here is 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!
Integrate Dexecure with your website