portal entry

select a category, or use search below
(searches all categories and all time range)
Title:

CF2018 – Clear folder specific template cache not working

| View in Portal
July 31, 2019 01:53:33 PM GMT
8 Comments
<p>We have CF2018 install and turn on “Trusted cache”. Server Product ColdFusion Version 2018,0,03,314033 Edition Enterprise Operating System UNIX OS Version 3.10.0-693.17.1.el7.x86_64 I have made modification to a cfm page and use the button “Clear folder specific template cache” and did not see the new changes until I use  all “Clear Template Cache now” button. Has anyone experience this issue with the cache turn on for CF2018 on linux server?</p>
<p>The post <a rel="nofollow" href="https://coldfusion.adobe.com/2019/07/cf2018-clear-folder-specific-template-cache-not-working/">CF2018 – Clear folder specific template cache not working</a> appeared first on <a rel="nofollow" href="https://coldfusion.adobe.com">ColdFusion</a>.</p>
Labels: CF2018 Updates, ColdFusion 2018, Question, 2018, cf2018 updates, coldfusion 2018, question

Comments:

Were you using the browse button in that UI to point to the folder in question? Did it produce a result that was exactly the right path? And if so, what if you hand-pasted into that UI element the exact path? Finally, if both of those are correct (and the clear template cache for folder still does not work), are you really 100% sure that the folder you're pointing to is the one where the template is running from? There are reasons that it may not be what you think it is. If you have debugging on, look at what it reports as the location of the file. Someone might propose you "just add a dump or log of the cgi scope", but since you are saying you make modifications and can't see the changes appear, that clearly won't work. :-) If you feel you cannot turn on the debugging output (even with the ip address list limitation feature), so that you feel totally stymied, I'll throw out a couple of guesses: <ul> <li>you could have a hosts file enabled, such that the web request you are making is not going against the server that you think it is</li> <li>you could have a virtual directory defined in your web server, such that a folder name you use in a url  may resolve by the web server to some different folder</li> <li>if on linux, you could have an symlink (or on Windows a junction) defined pointing things to a different folder than you expect</li> <li>in CF, you could have a mapping that is overriding the paths (if doing a cfinclude, or invoking a CFC, etc)</li> <li>if you ARE using an external web server (Apache or nginx on Linux, IIS in Windows--writing that for other readers), you may be falling victim to a quirk in CF, where it looks for files in the CF wwwroot (like [cf]\cfusion\wwroot, or [cf]\[instancename]\wwwroot if using instances), when the same-named file/folder path exists in both webroots</li> </ul> Let us know if any of this gets you going.
Comment by Charlie Arehart
2208 | August 01, 2019 03:15:27 PM GMT
Thanks Charlie for your response. We do have a lot of symlink and made sure everything in link correctly. I had use some of your codes in clearing the cache of individual files in CF9. We are in the progress of upgrading to CF2018 and this particular issue came up. I have debugging turn on and can see that the file path is correct. Once I change the text and select the folder from  CFadmin, I get the reply "Server has been updated successfull". It looks like everything work but when I reload the page  "test.cfm" file but I still see the old version of it. I can see the datetime of the file has just been update. I guess is there anyway to see what datetime file in CF memory for this file?
Comment by bobbyc87748371
2210 | August 01, 2019 05:24:21 PM GMT
There is not a way to see the datetime of the file in CF's memory (the template cache), no. As for your saying that it is the same/correct file path in the debugging info and the button to clear the cache, I will propose a few more things: <ul> <li>what happens if you instead clear the entire template cache? You may have wanted to avoid that, but in the interest of seeing if ANY clearing of the template cache will help (or not), it's worth trying.</li> <li>if that doesn't help, what if you restart CF? If you restart it and CF STILL does not pick up the change, then the issue is NOT about the template cache failing to be cleared, as it is cleared on a CF restart</li> <li>next, what if you saved the file as test1.cfm, in the same folder. Do you see the changes then, if you browse that page? If not, that tells us there's something else going on</li> <li>if that DOES work, and you feel that the problem is somehow unique to this test.cfm page, the next step would be to look at the cfclasses folder (in CF's wwwroot/WEB-INF/ folder), which holds the saved compiled classes (from CF files that were executed).</li> <li>Find any files names starting as cftest2ecfm. (All files there start with cf, and the 2e represents the . before the file extension.) Take note of the date/time, for a later step.</li> <li>There may be more than one like that, having different numerical values after the cfm, which would represent the way CF tracks the folder that it was in when it was executed/compiled.</li> <li>In the interest of time, just delete them all (just those which may start with cftest2ecfm). That will remove CF's saved class files for any test.cfm files you have.</li> <li>Then try either refreshing the page, or try clearing the template cache and THEN refresh the page.</li> <li>If that takes care of it, then something about that saved class file was the issue. Let us know what the date/time was of that file and of the corresponding file in cfclasses (that you tracked above)</li> </ul> Let's know how it goes.
Comment by Charlie Arehart
2213 | August 02, 2019 02:51:59 AM GMT
Yes, definitely the clear entire template cache works. This is an option but we don't want to do that for our production server. After CF restart, we see the text changes. If we create a new cfm file, we do see the new text change. Removing the class file did not help /CF2018/wwwroot/WEB-INF/cfclasses We have the following option turn on. Trusted cache Cache template in request Component cache Save class files A side question, is ECACHE the same as what they use to have in CF9? I'm wondering if switching different type of cache would clear this issue?
Comment by bobbyc87748371
2214 | August 02, 2019 03:11:27 PM GMT
<p>The fact that the page changes are picked up on either a CF restart (which clears the template cache) or clearing the entire template cache makes it seem that this really is down to some issue with the mechanism for clearing the cache just for a folder.</p><p>I have a couple of thoughts to help narrow that down for you, then for you to perhaps report to Adobe.</p><p>First, what update level for CF2018 are you on? The latest is update 4, released in June. And you should check to make sure there were no errors with whatever last update you DID do. See my blog post:</p><p><a href="https://coldfusion.adobe.com/2019/03/problems-applying-cf-update-check-first/">https://coldfusion.adobe.com/2019/03/problems-applying-cf-update-check-first/</a></p><p>Second, I will repeat: are you 100% sure that the path to the file in question is what was put into the field for clearing the cache for that folder? I had proposed previously that you literally copy/paste it (don’t type it). It could be an issue with the case, certainly in Linux (which you are on) but even in Windows (including the drive letter).</p><p>And to be clear, you are putting in the path as it appears to CF *on the server*, right? not some sort of relative path or mapped path as you may see it from off the server, right? (The “browse” button would also be sure to look only at the server, but I have seen that browse feature not always work as expected–even since CF10 when it was changed to being a jquery-based feature and not a java one.)</p><p>Finally, you ask about the caching: the CF template cache is not something we can influence, regarding what caching engine it uses.  I’m not sure if it does use ehcache. To be clear, yes, by default, since CF9, most caching things in CF that you can control (in code or admin) HAVE been based on ehcache–though of course the versions of that have changed since CF9. And as of CF2018, you an also now point to different caching engines. But again I don’t think the CF template cache follows that choice. That’s more about things like query caching, page content caching, object caching, etc.</p>
Comment by Charlie Arehart
2217 | August 02, 2019 05:11:34 PM GMT
I definitely try typing the folder path as well as cut and paste from the "cd" command line so it is the same path. So definitely not a typo issue. We are on CF2018 update 3. I'll ask for the admin to update but I don't expect much luck.
Comment by bobbyc87748371
2219 | August 02, 2019 06:52:42 PM GMT
While awaiting the update, are you or are you not able to check the update logs to confirm if there was any failure in the application of update 3? Since you have access to the server (command line), you can answer this in a matter of minutes. It's in your interest. The problem may be THERE. If it's not, and if applying the next update (4) doesn't help, then it seems it's time to file a bug report at tracker.adobe.com.  
Comment by Charlie Arehart
2218 | August 02, 2019 06:57:16 PM GMT
Yes, I forgot to mention I checked the log for update 3. Summary ------- Installation: Successful. 2351 Successes 0 Warnings 0 NonFatalErrors 0 FatalErrors Action Notes:
Comment by bobbyc87748371
2220 | August 02, 2019 07:19:30 PM GMT