cloudflare / template-registry

A simple API via a Worker that serves all the template content
https://developers.cloudflare.com/workers/templates
Apache License 2.0
62 stars 37 forks source link

Question about redirects #31

Closed SukkaW closed 4 years ago

SukkaW commented 4 years ago

https://github.com/cloudflare/template-registry/blob/master/templates/javascript/redirect.js

I have noticed that Response#redirect could be used to set up a 301/302 redirect easily. But is it possible to add Cache-Control header to 301 redirect? (Just like Cloudflare's Always Use HTTPS which adds cache-control: public, max-age=3600)

SukkaW commented 4 years ago

Achieved by manually build up a Response Object. Closed.