function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Erik YearyErik Yeary 

How do you prevent a community page from caching?

I have a full page lightning web component that we host on a community page and we share that page publicly. I've noticed that sometimes when I make changes to the LWC that I don't see the changes reflected on the community page unless I open the page in an incognito browser. This makes me think that my browser (chrome) is caching the page.

Because this page has already been shared publicly, some of our users are probably not getting my updates for the same reason. Is there a simple way to disable caching on this page?

(the disable persistent browser caching setting has no effect on this) 
AbhishekAbhishek (Salesforce Developers) 
The Enable secure and persistent browser caching to improve performance setting is enabled by default.

You have to Uncheck it.


For further reference check the below developer discussions,

https://salesforce.stackexchange.com/questions/144979/lightning-experience-how-to-prevent-the-display-of-obsolete-data

https://medium.com/salestrip/salesforce-lightning-component-caching-a39b6a9d01a7


If it helps you and close your query by marking it as solved so that it can help others in the future.

Thanks.
Erik YearyErik Yeary
What I meant is that checking or unchecking that setting appears to have no effect on this issue, and I'm assuming that is because the component is published on a community/force.com page instead of on a page within the org. 
AbhishekAbhishek (Salesforce Developers) 
No Erik.

Checking or unchecking will affect for sure.

And component will also effect but that's a different part.
 
Erik YearyErik Yeary
I believe I've seen this happen in sandboxes with that box unchecked... but maybe I should reassess that. Also, I don't understand your second sentence.

Regardless - is there an alternative solution? Unchecking that box in a production environment is not a viable solution anyway because that would greatly slow down loading of every page, and we only have one page that is an issue.
AbhishekAbhishek (Salesforce Developers) 
The second sentence states each component works differently.

Have to check each one then we can conclude which one is causing the issue.