Title:
Bug 86612:(Watson Migration Closure)When I try to do a CacheRemove for a specific CacheID, it works on our Dev server (which is running 9
| View in TrackerStatus/Resolution/Reason: Closed/Withdrawn/
Reporter/Name(from Bugbase): Roman Smolkin / Roman Smolkin (pixelwiz19801)
Created: 03/08/2011
Components: Caching
Versions: 9.0
Failure Type: Unspecified
Found In Build/Fixed In Build: 0000 /
Priority/Frequency: Trivial / Unknown
Locale/System: English / Platforms All
Vote Count: 0
Problem:
When I try to do a CacheRemove for a specific CacheID, it works on our Dev server (which is running 9.0.1) but not on Staging or Production server (which are running 9.0). I'm not sure if the version difference is the cause, but it's the only one I can come up with. There was a related issue I've read about on CFCACHE flushing and expireURL attributes with wildcards. Not sure if that's at all related. At the moment we can't upgrade stage and prod to 9.0.1 for several reasons.
Method:
Put some HTML into cache
<cfset cachePut("htmlcache_#CGI.SCRIPT_NAME#_#CGI.QUERY_STRING#",cachedHTML,createTimeSpan(0,0,0,30))>
Check what's in the cache:
<cfset arrayCacheIDs = CacheGetAllIds()>
<cfset listCacheIDs = "">
<cfdump var="#arrayCacheIDs#" label="before">
Figure out IDs to remove and remove them:
<cfloop from="1" to="#ArrayLen(arrayCacheIDs)#" index="i">
<cfif FindNoCase("leaderboards", arrayCacheIDs[i])>
<cfif ListLen(listCacheIDs) GT 0>
<cfset listCacheIDs = listCacheIDs & ",">
</cfif>
<cfset listCacheIDs = listCacheIDs & arrayCacheIDs[i]>
</cfif>
</cfloop>
<cfif ListLen(listCacheIDs) GT 0>Removing matched CacheIDs<cfset CacheRemove(listCacheIDs, "false")>
</cfif>
Check what's in the cache now.<cfset arrayCacheIDs = CacheGetAllIds()>
<cfdump var="#arrayCacheIDs#" label="after">
Result:
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3043533
External Customer Info:
External Company:
External Customer Name: Roman Smolkin
External Customer Email: 52B0693546A4D14B992015C2
External Test Config: 03/08/2011
Attachments:
Comments: