Through this blog, we will try to understand what the publishing HTML cache clearer error is and how you can resolve it while upgrading Sitecore.
During the process of upgrading Sitecore 9.2 to 10.2, you will find this error given below. When using Sitecore 9.2, the HTML cache clearer was used for multiple regions and multiple languages. But, it was creating issues when it came to Sitecore 10.2 So, let us resolve it using the below given steps.
Step 1 Go to your inetpub folder and go to the wwwroot folder.
Step 2 Go to your project folder and to the App_Congig folder.
Step 3 Go to the include folder and click on the project folder.
Step 4 Go to your website.config for an example: dev. website.config after removing the below code:
<events> <event name="publish:end"> <handler type="Sitecore.Publishing.HtmlCacheClearer, Sitecore.Kernel" method="ClearCache"> <sites hint="list"> <site hint="sitename">sitename</site> </sites> </handler> </event> <event name="publish:end:remote"> <handler type="Sitecore.Publishing.HtmlCacheClearer, Sitecore.Kernel" method="ClearCache"> <sites hint="list"> <site hint="sitename">sitename</site> </sites> </handler> </event> </events>
Step 5) Add the line: preventHtmlCacheClear="true" in site config and save the config.
<site name="custom_website" cacheHtml="true" preventHtmlCacheClear="true" />
Step 6) Refresh the site.
The error will now be gone and the website will perfectly load after the given steps.