Skip to content
Gallery
nytgames
CreativeTech Wiki (internal)
Share
Explore
Reference

icon picker
Caching Assets

Currently, assets stored in a Google Cloud bucket are implicitly CDN-cached through Fastly.

Checking to see if a resource is cached

Open Terminal and enter the following command:
curl -I url/path/to/resource
EXAMPLE: curl -I https://static01.nytimes.com/ads/adplatforms/cdn/ET/ad-tracking.js
In the list of head attributes will be a cache-control. Your max-age should be listed here. If cache-control is missing OR max-age is set to zero, your resource is not being cached. (Fig. 1)

Changing cache-control on a Google Bucket resource

Upload your asset to the bucket as you normally would.
Once upload is complete, select the “three dotted” menu to the right of the asset and select “Edit Metadata.” (Fig. 2)
Under “Cache Control,” insert the following: max-age=604800 (Fig. 3)
NOTE: The max-age is in seconds, so the above example will cache an object for 7 days. Feel free to change this value as necessary.
If you have to control your cache, do not set it max age to zero. This will ensure that the resource loads every time the resource is needs, removing the caching benefit altogether.
The recommendation for caching assets that may change frequently would be to set the max-age to max-age=3600. This ensures that the resource will fastly cache and expire every hour, so that resource would only ever load 24 times day from the bucket.
Save.

Fig. 1

Screenshot by Dropbox Capture.png

Fig. 2

Screenshot by Dropbox Capture.png

Fig. 3

Screenshot by Dropbox Capture.png
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.