What happens when Dexecure receives a request?

What happens when Dexecure receives a request?

Written by Inian Parameshwaran
Last update: Wednesday, Jan 08, 2020

First request to Dexecure

The very first time Dexecure receives a request for an asset for a particular device or browser, Dexecure pings your origin servers to retrieve the asset. We send back the original asset to the client after doing some operations synchronously (if required) like resizing, watermarking, rotating. Since the optimization of the resource can take time, we do it asynchronously. We send a s-maxage=30 header so that the CDN caches this unoptimized asset only for a short time.

First request to Dexecure after optimization is completed

The optimization for each asset usually takes around 30 seconds. When the CDN pings Dexecure again for the asset when the short cache time of 30 seconds we set in the previous step expires, we now send the optimized asset to the CDN. The CDN is instructed to cache the asset for the duration sent by the cache control headers sent by your origin.

On-going requests after optimization is completed

Once the CDN has the optimized resource, it is directly sent to users from the CDN's edge servers. The entire process repeats again when the CDN evicts its cache (because the cache time has expired or for some other reason) or when the same resource is requested from a different environment (this is because Dexecure optimizes resources differently depending on the device, browser and the network the user is on).

Caching

Caching behaviour of Dexecure

4 articles in this category.
Written by Inian Parameshwaran.