Skip to main content

How to Clear the CFML Template Cache

Developers can clear the ColdFusion or Lucee template cache to ensure that the application is running the most recent version of the code. This process is necessary when changes to .cfm, .cfm.cfc, or .cfc files are not appearing on the live site.

Before you begin

You will need:

  • Administrative access to the ColdFusion or Lucee environment with sufficient permissions to clear the template cache.

Clear the CFML Template Cache

Depending on your environment and access level, you can clear the cache using the ColdFusion Administrator or via the command line.

Using the ColdFusion Administrator

  1. Log in to the ColdFusion Administrator or Lucee Administrator.

  2. Navigate to Server Settings > Cache.

  3. Locate the Template Cache section.

  4. Click the Purge or Clear button.

Using the Command Line

If you have access to the server's command line, you can clear the cache by restarting the service or using a specific command.

Warning: Restarting the ColdFusion or Lucee service will temporarily take your website offline while the service reboots.

Open a terminal or command prompt.

  1. Execute the command to restart the service.

    • For ColdFusion: Use the ColdFusion Restart command or restart the ColdFusion service via the Windows Services manager.

    • For Lucee: Restart the Lucee service via the Windows Services manager or the relevant Linux service manager.

Confirm the result

  • Refresh the webpage where the modified code was implemented.

  • Verify that the changes are now visible to the end user.

  • If the changes are still not appearing, check for a secondary caching layer, such as a CDN or a local browser cache.

Troubleshooting

Changes still do not appear after clearing the cache

If the cache is cleared but the site remains unchanged, the issue may be caused by:

  • Browser Cache: Clear your browser's cache or attempt to view the page in an Incognito/Private window.

  • CDN or Proxy: If you use a service like Cloudflare, you may need to purge the cache at the edge.

  • Incorrect File Path: Verify that the application is pointing to the correct directory and file.

Limitations

This procedure only clears the internal ColdFusion or Lucee template cache. It does not clear external caches, such as those provided by a Content Delivery Network (CDN), a reverse proxy, or the user's web browser.

Did this answer your question?