add code of template functions called in nocache mode dynamically to cache file