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

Change or disable "Caching: https://????" message #12

Closed
CosmoMyzrailGorynych opened this issue Mar 12, 2021 · 1 comment
Closed

Change or disable "Caching: https://????" message #12

CosmoMyzrailGorynych opened this issue Mar 12, 2021 · 1 comment
Labels
enhancement New feature or request
Milestone

Comments

@CosmoMyzrailGorynych
Copy link

The plugin writes out the URL it caches, and some of these URLs contain sensitive data. (API keys lol. Run it on Travis CI and everyone in the world can get them from the public logs.)

It would be cool if the constructor could accept a flag like silent: true or name: 'Secret API request' so you can either completely hide or rename such requests in logs.

@zachleat zachleat added this to the v3.0.0 milestone Feb 25, 2022
@zachleat zachleat added the enhancement New feature or request label Feb 25, 2022
@zachleat
Copy link
Member

Importantly, the removeUrlQueryParams: true option has been present for some time to clean the URL params off of the URL prior to calculating the cache key and the clean URL used in console logs. It does not affect the raw url passed to the underlying fetch call.

https://www.11ty.dev/docs/plugins/cache/#remove-url-query-params-from-cache-identifier

That said, I think there is some additional work we can do here so I’m adding a formatUrlForDisplay(url) callback to the next version that will allow you to transform the URL however you’d like. This does not affect cache key hashing—only logging messages.

I’m also adding a verbose option and changing the default to false to avoid any console logs by default.

zachleat added a commit to 11ty/11ty-website that referenced this issue Feb 25, 2022
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

No branches or pull requests

2 participants