Skip to content

Cloudflare Worker to handle custom caching logic for CMS API responses.

Notifications You must be signed in to change notification settings

RegalRadio/cms-cache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CMS Cache

This Cloudflare Worker caches CMS responses at the edge.

By default, Cloudflare only caches HTTP responses with certain file extensions. This Worker lets us cache responses without these specified headers. It also lets us keep a specific Max-Age given by the CMS, instead of having Cloudflare override it with the domain-wide default as it would do if you added a Cache Everything page rule.

Instead of supplying a Cache-Control header (which may be manipulated by Cloudflare at the edge), the CMS puts a max age in a Cache-Max-Age header. This Worker takes that Cache-Max-Age and fills it into a Cache-Control header.

About

Cloudflare Worker to handle custom caching logic for CMS API responses.

Resources

Stars

Watchers

Forks