Domanda

I have several queries that I cache using the cachedwithin="#CreateTimespan(...)#" attribute of the cfquery tag. There are times when I need to clear the cache (or just re-execute the query to get a new cached copy). Historically, I've done one of two things to accomplish this -

  1. Restart the coldfusion service.
  2. Slightly alter the query in the code, say by adding or deleting whitespace.

Neither of these options are very good, especially when in production. I'm not asking for how I might expire the cache programmatically (although, that would be nice!), but more simply - how can I clear the cached queries on the server without having to resort to one of those two above methods? I'd be happy to hear about methods that work either server-wide, or application-wide, or even how to expire a specific cached query. Thanks!

È stato utile?

Soluzione

You can use the following:

<cfobjectcache 
    action = "clear" />

See cfdocs for a full explanation.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top