tracker issue : CF-3040478

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

Bug 80894:There appears to be a bug with the cfcache tag and the expireurl attribute

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Aaron West / Aaron West (Aaron West)

Created: 12/01/2009

Components: Caching

Versions: 9.0

Failure Type: Unspecified

Found In Build/Fixed In Build: 0000 / 262321

Priority/Frequency: Major / Most users will encounter

Locale/System: English / Mac 10 All

Vote Count: 0

Problem:

There appears to be a bug with the cfcache tag and the expireurl attribute. The docs for the final release state you can use wildcards, such as the asterisk, to target certain pages for removal from cache. For instance, you might want to remove all cached pages or page fragments that have marketing.cfm as part of the URL. I've tried the wildcard usage and it doesn't work. No matter what I put as the value for expireurl in the cfcache tag random pages (one at a time) seem to be removed from template cache. I showed an example of this behavior in my blog series on CF9 caching here: http://bit.ly/3UXuYv
Method:

Cache a page or page fragment using the cfcache tag and the useQueryString attribute set to true. Add some basic hyperlinks in the code so you can view the same template by passing in some URL parameters such as productID=1 or productID=2. This should cause several cached pages to show up in template cache. In a separate CFML template write a cfcache tag with the action attribute set to flush and the expireurl attribute set to *your-previous.cfm*.  Each time you run the page, instead of all the pages from the previous CFML being removed from cache, only one seemingly random page is removed. This happens each time you call the page with the flush code.
----------------------------------------------------------------------------------
[vmannebo 12/2/2009] Attaching a snippet from http://www.trajiklyhip.com/blog/index.cfm/2009/11/20/14-Days-of-ColdFusion-9-Caching-Day-4--Flushing-a-Template-From-Cache

1) Run this page
2) Click link "A second URL with pid=1"
3) Click link "A third URL with pid=2"
4) Click "Refresh this page without URL parameters"
5) Click "Flush Cache"

Although,expireurl="*wt-4.cfm*", pages are removed in a random order



<!--- wt-4.cfm --->

<!--- If the URL parameter 'flush' is defined, flush the cache for just this page. --->
<cfif isDefined("URL.flush")>
    <cfcache action="flush" expireurl="http://localhost/bugs/80894/wt-4.cfm">
</cfif>

<!--- Cache just a part of this page. --->
<cfcache action="cache" timespan="#CreateTimeSpan(0,0,0,45)#" useQueryString="true">
    <cfoutput>This date/time IS cached: #Now()#<br /></cfoutput>
</cfcache>

<cfoutput>This date/time is not cached: #Now()#</cfoutput>

<!--- Get the little bit of template cache metadata you can. --->
<cfdump var="#GetAllTemplateCacheIDs()#">
<br />
<a href="wt-4.cfm">Refresh this page without URL parameters</a>
<br />
<a href="wt-4.cfm?pid=1">A second URL with pid=1</a>
<br />
<a href="wt-4.cfm?pid=2">A third URL with pid=2</a>
<br /><br />
<a href="wt-4.cfm?flush=1">Flush Cache</a>
Result:

None

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3040478

External Customer Info:
External Company:  
External Customer Name: Aaron West
External Customer Email: 02D41227449187B39920157F
External Test Config: 12/01/2009

Attachments:

Comments: