Link to home
Start Free TrialLog in
Avatar of Grover McBroom
Grover McBroom

asked on

URGENT: ColdFusion 11 Cache not working as expected

I cannot seem to clear the template cache. No matter what I do, the same data remains from my cfquery example below. I've tried all possible combinations found in CF Administrator's Server Settings > Caching settings to release the query cache, EVERY option but nothing releases the cached query.

In ColdFusion 8 I was able to set "Maximum number of cached queries" from, say 200 to 1, which would clear the cache set in my CachedWithin setting.  Now, in ColdFusion 11, this does not seem work as I expected at all. It must be my lack of understanding but I've spent far too much time attempting to understand, read so many links to pages with discussion I cannot understand.

I would have thought that clicking one of the Clear Cache buttons in CF Administrator's Server Settings > Caching settings would clear the cache but it does not, even when that page looks like the screenshot I attached.

See the attached screen shot of CF Admin.

User generated image
My cached query will only be cleared when I remove (or sometimes edit) the "cachedWithin" statement on the query.

EXAMPLE:

<cfquery name="StoryInfo" datasource="anews" cachedWithin="#CreateTimeSpan(0, 0, 1, 0)#">
  select top 50 *
  from storybook
  where online = 1
  order by id desc
</cfquery>

I'll settle for removing all cached queries, system wide, when we add a new story and want it to be seen, and just as quickly as I did in CF8. But this new version of CF11 seems beyond me. I am not a  programmer but subbing for the one who died. I've read so many examples on the net but they assume I know more than I do which is quite frustrating.

The DOCS from Adobe seem written in nearly another language.  So, all I've been able to do is experiment.  I mean, all I want to do is remove the cache system wide so my changes will take effect and be seen, and without having to edit the CachedWithIn setting. Having to edit the cfquery seems pretty lame, no doubt my confusion and lack of understanding.

So, would someone please read this carefully and show me where I'm going wrong? This must be something very  simple I'm not understanding.
Avatar of erikTsomik
erikTsomik
Flag of United States of America image

Also I would recommend clearing the template cache and query cache by clicking Clear Query cache now.  Also you will need to remove cachedWithin from the queries.  Also please check application.cfm or application.cfc file if there any mentions about cache.

Please read this
https://forums.adobe.com/thread/1674373

Also I would clear a browser cache as well
Avatar of Grover McBroom
Grover McBroom

ASKER

erikTsomik >

Thanks for looking into this.

Absolutely not a browser cache problem.

As I said in my original question, I tried all the Clear Cache buttons in CF Admin and as I said, noe of them with any settings cleared the cache. None. I mean, why are they there if they will not clear any cache?

> Also you will need to remove cachedWithin from the queries.

Yes, that's the gist of my question, that I am being forced to edit and remove all existing cached queries that contain data that needs updting, that is, forced to remove the "cachedWithin" setting altogether.

We have hundreds of such "cachedWithin" settgings. Surely either I don't understand what you mean, or you don't understand my question or I phrased it wrong, I have to hope so!  This cannot be the case, having to edit and  remove each "cachedWithin" code just to clear cached queries. I'm sure you'll agree that would be ridiculous.

My application.cfm file does not contain any "cachedWithin" settings at all.

As far as the link you have, I already saw it long ago. I did place it onto a separate page to run:

<cffunction name="onRequestStart" hint="">
<cfif structKeyExists(www.domain.com/news/news1.cfm, "reinit")>
<cfset cacheRemoveAll()>
</cfif>
</cffunction>

When run there is no feedback and no query cache is cleared.

Would you use my example query and give me code based on it to clear the cache? Also, let me know where to place it, in a file by itself and if needs to use a URL, use the one I gave. I also tried it without the URL.

Nothing is working. Hope that helps you.
ASKER CERTIFIED SOLUTION
Avatar of Grover McBroom
Grover McBroom

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Found workable solution myself.