evidence
evidence copied to clipboard
Parquet file paths are no longer hashed unlike other static site assets breaking common caching pattern
Describe the bug
Path to parquet
files not being hashed breaks caching model on hosted sites if we were to follow the same default pattern for a typical vite static sites.
Parquet files do not have a hash in the path anymore (@csjh mentioned this PR), this causes issues with cloud/hosting caching
Vite auto-hashes .css
and .js
files which varies between builds. This allows us to set a long cache expiry time on these files. As long as the index.html
files are not cached and everything else is, the user should see the latest when browsing.
However, if parquet
file name/paths are no longer hashed then we can't apply the same pattern - which is consequential given how large parquet files can be.
Notes from discussion.
Problem
Parquet files do not have a hash in the path anymore, this causes issues with cloud caching
Vite auto-hashes .css
and .js
files
.parquet
files are large enough that caching them is important
- Caching them makes looking at sources more difficult locally
- Removal of outdated source files becomes more complex
Solution
As part of the build process, when we copy sources over to build
, we should hash the content and update the manifest.json
Should include tests to ensure that built output has hashing for parquet paths
- Checks both the
manifest.json
and the parquet filepaths
Steps to Reproduce
- Deploy a site with cache expiry set to 1 hour
- Rebuild the evidence project
- The parquet files could be outdated after the rebuild
Logs
No response
System Info
https://github.com/evidence-dev/evidence/pull/2065
Severity
serious, but I can work around it
Additional Information, or Workarounds
No response