Skip to content

Add fingerprint to compiled css/js files #439

Closed

Description

@tooooolong

Case we have CDN front of our website, So main.css can not update automaticly.

Now, the css tag is:

<link rel="stylesheet" href="/css/main.css">

I think it should add fingerprint to static files.
Something like this:

<link rel="stylesheet" href="/css/main.build_hash.css">

Activity

  1. added
    status: needs more information
    on Feb 27, 2018
  2. JoelMarcey commented on Feb 27, 2018

    @JoelMarcey
    Contributor

    Hi @tooooolong! How would one know whether a fingerprint should be used? Some sort of configuration option?

  3. tooooolong commented on Feb 27, 2018

    @tooooolong
    Author

    maybe something like this。

    webpack/webpack#86 (comment)

    this is a plugin for Webpack, it will add a hash to the static file name automatically.

  4. added
    feature
    on Apr 15, 2018
  5. yangshun commented on Apr 15, 2018

    @yangshun
    Contributor

    This is a good idea 👍

    I think fingerprinting can be turned on by default. It's also necessary in PWAs because they cache the content via paths.

    This only needs to be done during the build phase. The <Head> component will need to take in the fingerprinted CSS file name and cannot hardcode main.css.

  6. added
    difficulty: advanced
    and removed
    status: needs more information
    on Apr 15, 2018
  7. gedeagas commented on May 10, 2018

    @gedeagas
    Contributor

    is anyone taking this @yangshun? I can work on this in the coming weeks

  8. yangshun commented on May 10, 2018

    @yangshun
    Contributor

    Sure thing, it's yours!

    I've added an "issue-claimed" label so that others will know not to start work on the issue. If you change your mind about the issue, no worries! Just let me know so that I can remove the label and free it up for someone else to claim.

    I'll check in with you periodically so that we can keep the task updated with the progress.

  9. added
    status: claimed
    on May 10, 2018
  10. gedeagas commented on May 10, 2018

    @gedeagas
    Contributor

    Awesome 😎

  11. gedeagas commented on May 23, 2018

    @gedeagas
    Contributor

    Hi, @yangshun can you check my code? #694

  12. added
    better engineering
    and removed
    feature
    on Jun 2, 2018
  13. added and removed
    status: claimed
    better engineering
    on Jul 18, 2018
  14. endiliey commented on Oct 23, 2018

    @endiliey
    Contributor

    Implemented in v2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    difficulty: advanced

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions