datamade / bga-payroll

💰 How much do your public officials make?
4 stars 4 forks source link

Store compressed JS outside of project dir, or force recompression by clearing cache on deploy #503

Closed hancush closed 3 years ago

hancush commented 3 years ago

Compressed files are stored in the project directory, which is removed on deployment. This is an issue for cached pages that reference the compressed files, which no longer exist. Store these outside of the project directory, so they don't get obliterated on deployment.

hancush commented 3 years ago

Addressed this by specifying that compressed output should be stored inline (i.e., with the cached page) instead of in an external file. The effect is that we'll need to compress on the fly when pages age out of the cache, but it was worth the tradeoff of keeping things straightforward.