DEV Community

Discussion on: React cache issue in new build

Collapse
 
athuldom profile image
athul dominic

for setting for assests url, do we need to set from frontend or backend (server side) ?

Collapse
 
webjose profile image
José Pablo Ramírez Vargas

Back-end. Your HTTP server needs to add the Cache-Control HTTP header in the response to no-cache. This is sufficient so long your HTTP server calculates and sends the ETag header. Then you'll be in the ideal position.

Nginx calculates ETag's by default, I think, so it is a matter of adding the HTTP header. If you're not using Nginx to server your website, you need to search on how to do this in your server of choice.