Skip to content
This repository has been archived by the owner on Mar 8, 2020. It is now read-only.

Add hash as query string #157

Open
mpaluchowski opened this issue Jan 19, 2019 · 4 comments
Open

Add hash as query string #157

mpaluchowski opened this issue Jan 19, 2019 · 4 comments
Labels
feature New feature or request

Comments

@mpaluchowski
Copy link

Can we have a way to add the content hash as query string for the generated files?

Right now I can set:

prefix: '[hash]/

which does the job, but creates lengthy and ugly URLs, that later make it difficult to review cache reports and similar, whereas if the hash was in a query string, it's often ignored or can be easily hidden in reports.

Ideally, I'd love the output to be similar to:

<link rel="apple-touch-icon" sizes="60x60" href="/apple-touch-icon-60x60.png?791c3814a0650f9555ddd744b3e2fe77">
@brunocodutra
Copy link
Owner

brunocodutra commented Jan 19, 2019

That is not a bad idea, what about we add a suffix option, where the user could specify '?[hash] and default it to ''?

On the next major release I'd even be willing to change the default behavior such that suffix defaults to ?[hash].

@brunocodutra
Copy link
Owner

On a side note, you can also use [hash:8] (or whatever number) to truncate the hash, which might be useful even for the query string.

@mpaluchowski
Copy link
Author

Yes, postfix sounds very good. Certainly more versatile than an explicit hash option.

And I din't know I could truncate the hash. Thanks!

@brunocodutra
Copy link
Owner

I've since realized suffix might be a better term, but yeah, great idea thanks!

@brunocodutra brunocodutra added the feature New feature or request label Jan 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants