# Overview

Marfeel architecture relies on several caching systems. The strategies put in place allow Marfeel to reduce the time necessary to deliver content to users, all the while minimizing the load on publishers' servers.

# Cache layers

Several layers compose Marfeel caching system:

  • Tenant's infrastructure: There may be cache layers on the tenant's end, independently of Marfeel.
    • Another CDN,
    • Custom implementations...

TIP

  • When MarfeelCDN is active, it replaces this layer.
  • A domain with another CDN can't activate MarfeelCDN, as we cannot guarantee the caching behavior in those cases.
  • Fastly is the CDN provider Marfeel uses, composed of two layers:
    • Shield is a cache layer designed to protect origin servers. All requests go through this layer before hitting origin servers to decrease the load on those.
    • Edge is a cache distribution network that guarantees the fastest response based on the end-user location.
  • Websites that use MarfeelCDN also enjoy a second shield, M-Shield.
  • Marfeel server, Gutenberg, uses EhCache (opens new window), a standardized Java cache layer. It caches NFS files, Database objects from MongoDB, and data from the Java application.

Find how these layers interact with each other in this article.

TIP

Caching on the client-side refers to the cache layers between the reader of the page and the Marfeelized version.

Caching on the server-side refers to the cache layers between the tenant's origin server and Marfeel extraction systems.

# MarfeelCDN

MarfeelCDN is a product that tenants can choose to activate. It is a server-side cache layer that will, among others, reduce the stress on their origin servers.

TIP

MarfeelCDN is placed in front of the tenant's origin server.

MarfeelCDN is also active for Marfeel's backend, Gutenberg.

MarfeelCDN also moves the activation logic from the garda.js script to server-side device detection:

Marfeel activation server-side

MarfeelCDN also automatically optimizes images for mobile requests, adapting to each device.

Tenants must follow the CDN wizard to activate MarfeelCDN: it can be done before or after activating Marfeel itself.

TIP

Following Marfeel's extensibility philosophy, the custom CDN configuration of every tenant is part of the tenant's source code, in the cdn.json file.

You can read up on all the available configuration flags in the catalog.

# Cache and freshness

Marfeel balances caching resources and content freshness thanks to services like µSmint. Custom cache headers are a goldmine of information to know if a resource served by Marfeel is fresh.

TIP

Content freshness not only depends on caching policies, the invalidation systems extract fresh content when it is necessary. It is also possible to manually invalidate a resource or document to update it. ::