DreamSpeed CDN Advanced Cache Settings

Your content is stored in the DreamSpeed CDN cache for 30 days by default. You have full control over the cache settings using standard HTTP caching headers. This allows you to control for how long your content is stored in the cache as well as in the web browser.

HTTP Headers
You can set four different types of HTTP headers which will have different effects on the CDN and on web browsers. If you use more than one type, they are prioritized in the order listed below:


 * Surrogate-Control
 * This header is only visible to DreamSpeed CDN and is ignored by the browser.


 * Cache-Control: s-maxage
 * This is the same as Surrogate-Control, except the header is not stripped and will be respected by DreamSpeed CDN, as well as any caches between it and the browser.


 * Cache-Control: max-age
 * Will be respected by all of the above and the browser.


 * Expires
 * Caches content until the specified time. This header will be respected by all of the above and the browser.

Do Not Cache

 * You can specify a file to not be cached by setting Surrogate-Control or Cache-Control to:


 * You can also set the Expires header to a date in the past.

Set HTTP Headers with Cyberduck
Cyberduck is a free file transfer app that works with DreamObjects and also allows for setting Cache-Control headers. Follow the instructions in our wiki for configuration with DreamObjects.


 * 1) Select a file and click Info from the Action menu.
 * [[File:cyberduck-info.png]]
 * 1) Select Metadata. Click the gear drop down and select Cache-Control. The Cyberduck default settings for Cache-Control are public and a max-age of 2592000 seconds (which is 30 days).
 * [[File:cyberduck-metadata.png]]

Set HTTP Headers with the Python boto Library
The Python library called boto allows you to interact with DreamObjects over its S3-compatible API. Follow the instructions in our wiki for configuration with DreamObjects.

The script below will set the Cache-Control header to a max-age of 2592000 seconds (30 days) of all JPG and PNG files in the bucket you specify.

Purge Cache
If you make an update to your files stored on DreamSpeed CDN, you'll want to purge the cache so that it does not serve the stale content. This is easily done in the DreamObjects control panel.


 * 1) Click the Change Settings link for the bucket you want to purge from DreamSpeed CDN to bring up the Bucket Settings window.
 * 2) Click the Purge Now button and confirm the action in the dialog that appears.. The cache will be cleared within 2 seconds and the cache will be refreshed the next time someone requests it.
 * [[File:dreamspeed-purge.png]]