mdn / stumptown-deployer

🚢 those static Stumptown sites
Mozilla Public License 2.0
4 stars 6 forks source link

Custom headers file #6

Open peterbe opened 5 years ago

peterbe commented 5 years ago

At the moment Cache-Control headers are controlled via some hardcoded logic plus some default environment variables. It would be better to leave this outside of the deployer and instead check in a file, possibly in stumptown-renderer that defines these things.

For example, we might create a file called headers.txt inside the stumptown-renderer repo and used like this:

stumptown-deployer upload ~/stumptown-renderer/client/build/ --headers=~/stumptown-renderer/headers.txt

It could look something like this:

*   [TAB]   Cache-Control   [TAB]   max-age=86400,public
/static/*   [TAB]   Cache-Control   [TAB]   max-age=31536000,public
/static/service-worker.js [TAB]   Cache-Control   [TAB]   no-cache