# How Images Are Cached And Moved to CDN from the Luminate FTP

There are two behaviors setup in test https://d290h2g0ajcvb3.cloudfront.net and production https://dx2eq2oh924g4.cloudfront.net CDNs which are configured to front assets from their respective Luminate instances. The wildcard paths for these behaviors are:

  • /images/content/pagebuilder/*
  • /wrpr/images/*

For example, the image https://lo-test.savethechildren.org/images/content/pagebuilder/1150.jpg in Luminate test enviornment can be pulled from the CDN at https://d290h2g0ajcvb3.cloudfront.net/images/content/pagebuilder/1150.jpg. The sync for these behaviors occurs in real-time as the assets are requested. The logic is something like this:

  1. User requests https://d290h2g0ajcvb3.cloudfront.net/images/content/pagebuilder/1150.jpg
  2. CDN edge server searches local assets to see if asset is already cached.
    1. If cached version is present and not expired then return it.
    2. If cached version is expired then continue.
    3. If asset is not in cache then continue.
  3. CDN edge server makes request to Luminate to fetch asset per its relative path (/images/content/pagebuilder/1150.jpg).
  4. CDN edge server caches response. The asset will be cached for one day by default. If Luminate's response contains a cache time-to-live then the CDN will cache the result for that amount of time.
  5. CDN edge server returns result to user.

# Rules

# Test Enviornment

Luminate URL (from): https://lo-test.savethechildren.org/images/content/pagebuilder/tote-alt.jpg
CDN URL (to): https://d290h2g0ajcvb3.cloudfront.net/images/content/pagebuilder/tote-alt.jpg

# Production Enviornment

Luminate URL (from): https://support.savethechildren.org/images/content/pagebuilder/tote-alt.jpg
CDN URL (to): https://dx2eq2oh924g4.cloudfront.net/images/content/pagebuilder/tote-alt.jpg