How to caching static js and css files in react app?

There is a link of my project

Please help me to cache js and css files for 10 minutes. Thanks.

I’m not sure what you mean by “on 10 minutes.” If you want to instruct the browser to only use the cached version for 10 minutes, I don’t think you can do it without controlling the server. The reason is that the client has to decide whether the file is even worth downloading again, which means the “expiration date” for cached files comes in the HTTP header, as a cache-control directive. The following links should explain.

Easier:
https://varvy.com/pagespeed/cache-control.html

More complete:

1 Like