Achraf Kassioui

Blog

Disabling cache for web development

Caching on web browsers can be counterproductive during development. Firefox, Safari and Edge are F5 friendly and correctly reload modified external files. But Chrome is more aggressive with caching, and requires either a hard reload on desktop, or a manual cache dump on Android.

Disabling the cache with the developer tools isn’t good enough:

But there is a solution! Instead of looking at the browser side, we can disable caching server side.

During development, we can use a local server like http-server, which is a node.js based web server that can be started from any directory with one command line:

http-server -c-1
http-server -c-1 in Windows command line
Navigate to any directory in the command line, and launch a server there with http-server. On Windows, you can open a command line prompt in any directory from the contextual menu with Shift + Right-click.

No more keeping the dev tools open, or force reloading a page, or manually clearing the cache on Chrome for Android!