Select your language

  • Davide Gammone

            

Davide Gammone.com
How to disable the cache in Salesforce Lightning Component

Salesforce help the runtime performance by caching components in the client. This is positive for the end users because page loads are fast. But is not very good for developers when developing Lightning Components, because they may think the code is wrong, or they have to hit hard refresh a few times while the cache is cleared.

We can fix this problem via configuration:

  • Session Caching

Go to Setup > Session Settings > Caching 

and deselect Enable secure and persistent browser caching to improve performance

Pay attention that this is an Org-Wide Setting.

Do not do this in Prod because caching improves performance and you shouldn’t need to test in Prod!

Another useful setting is:

  • Debug Mode

Go to Setup > Develop > Lightning Components > Debug Mode

then check the box next to your user and click Enable.

Enable debug mode to make it easier to debug JavaScript code from Lightning Components. Only enable debug mode for users who are actively debugging JavaScript.

Salesforce is slower for users who have debug mode enabled.

GDPR Alert

This site uses cookies, including third-party requests, to offer you services in line with your preferences. By closing this banner, scrolling this page or clicking any element, you consent to the use of cookies. If you want to learn more or opt out of all or some cookies, click on Privacy Policy...