0

On the, The Net Ninja Youtube channel I see the Ninja has disabled cache in his Laravel 6 tutorial. Just curious what's the benefit over enabling when coding?

1 Answer 1

2

So that changes made to resources loaded into the page, such as images, stylesheets, and scripts are always refreshed and reloaded when the page itself is reloaded (so you don't need to remember to press Shift+F5 or Ctrl+Shift+R).

When caching is enabled the browser may prefer its cached versions which may be stale instead of always using the latest-built assets.

However disabling caching is unnecessary if you use a content-addressing scheme for off-page resources (i.e. the URI of a script file or stylesheet includes its content hash (SHA-256, etc)).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.