ember-fastboot / fastboot-app-server

A production-ready app server for running Ember FastBoot apps
140 stars 72 forks source link

Asset files are not cached #119

Closed lstrzebinczyk closed 4 years ago

lstrzebinczyk commented 4 years ago

After deploying an app powered by fastboot I noticed that assets (js + css files) are served with

cache-control: no-cache

Which is very unfortunate, because they are perfect for browser caching. I believe assets are served via https://expressjs.com/en/starter/static-files.html, which provides no primitives to set the headers.

Maybe it would be better to use something like https://expressjs.com/en/resources/middleware/serve-static.html, there seems to be a lot of cache-related setup available in it.

Thoughts? I might be able to throw in a PR.

lstrzebinczyk commented 4 years ago

I was able to get this running by more-or-less copying what https://github.com/dollarshaveclub/fastboot-docker did. I still think this should be easily done by config withing this server, but it's doable. I'm closing the issue.