When developing Lightning Components, how do you get the component to refresh?

In Salesforce Setup, go to Security > Session Settings. In the Caching section, uncheck "Enable secure and persistent browser caching to improve performance".

This is the right setting during development to make sure that the changes you make to your component take effect immediately and that you are not served a cached version of the component.


If you do not have dependencies defined in the Application bundle then Lightning will not check for changes. In that case I found prior to Spring '17 it took 3 refreshes of the browser to get the updated version.

After Spring '17 I refresh the browser twice upon making changes when no dependency is defined.

If a dependency is defined then the browser will detect it and refresh automatically


If you're using Chrome, there's an extension called clear cache that will do what you want. You click on it and it clears the cache so the latest version of your component will load when you refresh the page since it will no longer be in the cache. It also will automatically force a refresh of the page for you when you click on it.