How to set cache ttl for static assets with workers sites?

When i test my site with pagespeed, all the images have no cache ttl set.

how do i do it?

Is there any type of headers sections for those images in the Workers script? You can add this in with the other image headers:

      'cache-control': 'max-age=31536000',

where can i find it?

i just follow the tutorial to deploy a jekyll site

In, click on the Workers link in the right column and find your site’s script. Then click “Quick Edit” and comb through the code.

@sdayman or anybody else willing to answer: Does this apply only to Workers sites that have been deployed to something beyond the “” level — i.e., given custom domains? I’m just testing this stuff with a Hugo-created static site, similar to what @tuananh mentioned for a Jekyll site — except that the Hugo site already existed, so I used the instructions for adapting an existing site. The cache-control headers for the woff2 and css files all show up with no-cache, contrary to what I’d have expected from The Workers site in question is

I found the following at but don’t know if it’s related:

A Cloudflare Worker is a piece of JavaScript code that runs every time you access a specific route on a website proxied by Cloudflare. The code is executed on every request before they reach Cloudflare’s cache. This means Worker responses are not cached (although requests made by the worker to other web services might be cached with the appropriate caching headers).

Bump, bump. I would appreciate an answer to my question (#5 in this topic), even if it’s only to tell me to buzz off because this sort of thing isn’t for people without intimate knowledge of Workers sites. That, I would certainly understand. :slight_smile:

Finally got an answer, on Stack Overflow.