System Design · Middle · Question 9 of 75

How should JS and CSS bundles be cached?

Explanation

The name app.3f9a1c.js changes when the content changes, so the file can be cached "forever". The HTML that references the bundles is cached briefly or with revalidation, so a new release is picked up immediately. Bundlers do the hashing automatically.

Further reading

Problem with a question

System Design · Middle · question 9

Test yourself

Take the System Design · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz