Create-react-app: Add the word ".cache." into generated files that can be long-cached

Created on 15 May 2017  路  4Comments  路  Source: facebook/create-react-app

For example, instead of:

main.cc6a6b04.css
main.88312ef0.js

do this:

main.cc6a6b04.cache.css
main.88312ef0.cache.js

This makes it a bit easier to configure http headers based on pattern matching.

proposal

Most helpful comment

I feel like [.]\w{8}[.] is a pretty trusty heuristic. [.]\w{8}[.](js|css|svg|etc) if you want to be super safe.

All 4 comments

Is this a common practice? Do any CDNs use a convention like this automatically?

I feel like [.]\w{8}[.] is a pretty trusty heuristic. [.]\w{8}[.](js|css|svg|etc) if you want to be super safe.

This naming convention was used by GWT (the very first bundler I ever used). Then, I found some web pack sample configs that used it:

filename: "[name].[hash].cache.js"

Is this a common practice?
I thought it was. Maybe just in my own mind :)

But I would imagine some people who are not regex experts might be more comfortable with the .cache. naming convention.

Not feeling strongly about this. If more people ask for it we can do it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fson picture fson  路  3Comments

alleroux picture alleroux  路  3Comments

DaveLindberg picture DaveLindberg  路  3Comments

JimmyLv picture JimmyLv  路  3Comments

fson picture fson  路  3Comments