Old copy of template is running - how do I clear the cache?



  • I see this in the debug log: "Taking compiled template from engine cache"

    And I also see some stuff sent to the console that is now commented out. I think an old version of the template is being rendered. How do I clear the cache or force a rebuild of the cache?


  • administrators

    I think an old version of the template is being rendered. How do I clear the cache or force a rebuild of the cache?>

    the cache key used for storing the compiled template is the template content + the engine used, so any time you change the content or the engine is changed the render won't use the previous compiled cache.

    you can disable the cache at all by using this in your configuration file:

    {
      "templatingEngines": {
        "templateCache": { "enabled": false }
      }
    }
    

    i have to say that the cache should work fine, i don't think it should be taking old template if you have changed the content of template, but if you have some steps to reproduce that we will more than happy to fix it (if the bug exists)



  • And, I'm an idiot again. Turned out the log messages I thought were coming from the main script were coming from a handlebars helper. Duh. I shouldn't have put the same thing in two places.


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.