evidence-dev / evidence

Business intelligence as code: build fast, interactive data visualizations in pure SQL and markdown
https://evidence.dev
MIT License
4.33k stars 204 forks source link

Parquet file paths are no longer hashed unlike other static site assets breaking common caching pattern #2626

Open ud3sh opened 2 weeks ago

ud3sh commented 2 weeks ago

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

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

Steps to Reproduce

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

archiewood commented 2 weeks ago

Note, this pattern may restrict any "remote parquet" solutions in the future, whereby users bring their own or point to parquet files which are not built by Evidence.

This would be a common pattern for e.g. Iceberg tables