There are two methods of integrating Dexecure with custom built websites. In this article, we will look at integrating Dexecure via the URL method.
Integrating Dexecure this way is very similar to integrating with any CDN.
Let's optimize assets being served from example.com
Getting your Dexecure Domain
Login to Dexecure Dashboard and create a Dexecure domain at https://app.dexecure.com/dashboard.
Go to the website and add the domain you want to optimize.
Once you add a domain in the dashboard, you would get a Dexecure domain like xxx.cloudfront.net
Change your HTML to load assets from your Dexecure domain instead of example.com. For example, here is how you would optimize images via Dexecure
Change your HTML from
<img src="https://example.com/image.png" />
To the following
<img src="https://xxx.cloudfront.net/image.png" />
*You can also add the Dexecure domain to your build config so that all assets can be changed to Dexecure URLs when building your website.
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