Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ud3sh opened this issue Oct 8, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@ud3sh
Copy link
Member

ud3sh commented Oct 8, 2024

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

@ud3sh ud3sh added bug Something isn't working to-review Evidence team to review labels Oct 8, 2024
@archiewood archiewood removed the to-review Evidence team to review label Oct 9, 2024
@archiewood
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants