# 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:
- User requests
https://d290h2g0ajcvb3.cloudfront.net/images/content/pagebuilder/1150.jpg - CDN edge server searches local assets to see if asset is already cached.
- If cached version is present and not expired then return it.
- If cached version is expired then continue.
- If asset is not in cache then continue.
- CDN edge server makes request to Luminate to fetch asset per its relative path (
/images/content/pagebuilder/1150.jpg). - 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.
- 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