Caching is an important aspect of most web projects, it allows you to reach the best performance and reduce load at your origin website.

When you activate caching, Edgee acts as a CDN (Content Delivery Network), caching content based on response headers to help you deliver a faster user experience.

Activate or disable caching

Browse to your project’s Performance panel and select Cache.

From here, activating or disabling caching for your project is a one-click operation. Simply click the toggle on the right hand side.

How to activate or disable caching on Edgee. Click on the image to zoom in.

That’s it! Now you can enjoy faster page loads.

Supported HTTP headers

Edgee runs on hundreds on PoPs (Points of Presence), where content is cached to speed up your website.

The caching behavior depends on specific HTTP headers that you can send back as part of your responses to set a specific TTL (Time to Live). If you enable caching without any explicit caching header, the default TTL is 3600 seconds (1 hour).

Edgee supports the following caching headers:

  • Surrogate-Control: instructs Edgee to set a maximum TTL, e.g. max-age=31557600 (1 year TTL)
  • Cache-Control: instructs the browser to set a maximum TTL, e.g. no-store, max-age=0 (no client-side cache)
  • Expires: instructs the browser to cache the response until the specified data, eg. Wed, 23 October 2024 00:00:00 GMT
  • Age: indicates that an object has already spent some time in an upstream cache, which will be subtracted by the response’s max-age to compute the maximum TTL
  • ETag: a unique version identifier that only changes after a resource is modified, e.g. 123dq37891dc-it21
  • Vary: indicates the list of headers that must match to consider a response cached, e.g. Accept-Language, User-Agent

Note: usually you want to set a long value for Surrogate-Control as Edgee can revalidate the origin response. On the other hand, you normally want to set a shorter value (or even zero) for client-side caching (unless it’s a static resource that changes path at each deployment, like bundled JavaScript libraries).