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

Human readable cache file names #24

Closed
nchan0154 opened this issue Jun 2, 2022 · 3 comments · Fixed by #49
Closed

Human readable cache file names #24

nchan0154 opened this issue Jun 2, 2022 · 3 comments · Fixed by #49
Labels
enhancement New feature or request

Comments

@nchan0154
Copy link

Thanks for this plugin, I use it -a LOT-. One thing I loved about eleventy-cache-assets is that the filename represented the cache name, so if I needed to edit a particular file to mock some data, it would be easy to locate it. I often do things like change properties on my object responses to test different states, copy and paste a bunch of items to show how pagination would look, etc. Will there ever be an option to generate human readable names for the cache files?

@BigBlueHat
Copy link

BigBlueHat commented Jun 16, 2022

This used to be possible, but the change in this commit forced all the uniqueKey values to be hashed.

It shouldn't be too hard to add an option to bring back a non-hashed file name. @zachleat is that something you'd consider bringing back through an option on AssetCache?

It's definitely a feature I miss also.

@zachleat
Copy link
Member

I think a callback that allows you to add your own hashing function would be nice! I’m open to a PR for this!

@zachleat zachleat added the enhancement New feature or request label Mar 17, 2023
chriskirknielsen added a commit to chriskirknielsen/eleventy-fetch that referenced this issue Oct 20, 2024
@chriskirknielsen
Copy link
Contributor

I've needed this more than once so I made PR #49 to allow custom filenames. Edits are welcome, currently it only covers what I would usually need. 😄

@zachleat zachleat added this to the Eleventy Fetch v5.0.0 milestone Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants