July 31, 2019
CF2018 – Clear folder specific template cache not working
Comments
(9)
July 31, 2019
CF2018 – Clear folder specific template cache not working
(9)

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?

9 Comments
2019-09-12 17:29:22
2019-09-12 17:29:22

Thanks Charlie for all your help and eventually we submitted a ticket with Adobe CF support and resolve the issue. There was an issue with the symlink with the apache server and CF.  The document root need to be a real path and not a symlink. Somehow this confuse CF clear cache. Afterward, clearing the template directory or a cf file works.

 

Like
2019-08-02 15:11:27
2019-08-02 15:11:27

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?

Like
(4)
>
bobbyc87748371
's comment
2019-08-02 17:11:34
2019-08-02 17:11:34
>
bobbyc87748371
's comment

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.

I have a couple of thoughts to help narrow that down for you, then for you to perhaps report to Adobe.

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:

https://coldfusion.adobe.com/2019/03/problems-applying-cf-update-check-first/

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).

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.)

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.

Like
>
Charlie Arehart
's comment
2019-08-02 18:52:42
2019-08-02 18:52:42
>
Charlie Arehart
's comment

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.

Like
>
bobbyc87748371
's comment
2019-08-02 18:57:16
2019-08-02 18:57:16
>
bobbyc87748371
's comment

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.

 

Like
>
Charlie Arehart
's comment
2019-08-02 19:19:30
2019-08-02 19:19:30
>
Charlie Arehart
's comment

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:

Like
2019-08-01 15:15:27
2019-08-01 15:15:27

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:

  • 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
  • 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
  • if on linux, you could have an symlink (or on Windows a junction) defined pointing things to a different folder than you expect
  • in CF, you could have a mapping that is overriding the paths (if doing a cfinclude, or invoking a CFC, etc)
  • 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

Let us know if any of this gets you going.

Like
(2)
>
Charlie Arehart
's comment
2019-08-01 17:24:21
2019-08-01 17:24:21
>
Charlie Arehart
's comment

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?

Like
>
bobbyc87748371
's comment
2019-08-02 02:51:59
2019-08-02 02:51:59
>
bobbyc87748371
's comment

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:

  • 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.
  • 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
  • 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
  • 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).
  • 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.
  • 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.
  • 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.
  • Then try either refreshing the page, or try clearing the template cache and THEN refresh the page.
  • 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)

Let’s know how it goes.

Like
Add Comment