Clearing the template cache programmatically

In coldfusion to clear the template we can do like:

<cfscript>
  adminObj = createObject("Component", "cfide.adminapi.administrator");
  adminObj.login("cfadmin_password"); //change to use your CF Admin password
  rtService = createObject("component", "cfide.adminapi.runtime");
  rtService.clearTrustedCache();
  rtService.clearTrustedCache("C:\inetpub\wwwroot\test.cfm,C:\inetpub\wwwroot\test2.cfm");
 </cfscript>

anyone know, how we do this in lucee?

all you need is pagePoolclear()

it would be nice if it was a bit more flexible as i outlined here

https://lucee.daemonite.io/t/pagepoolclear-cfobjectcache-action-refresh/2825

2 Likes