6 Replies Latest reply on Oct 17, 2012 2:58 AM by Ernesto RA

    What is the scope of the queries cached with cachedwithin on CF10? Server or application?

    Ernesto RA Level 1

      Hello,

       

      We have recently migrated from CF8 to CF10 and noticed an unexpected behavior on our cached queries.

       

      We are a news site and have two applications on our server (CF 10, Centos 5.8 64 bits), one for the front-end to readers, and another one for administrators of the site. We made extensive use of cached queries, always with cachedwithin, and always on CFCs. When a user read an article, the query that retrieve that article is cached for 15 minutes, and if an administrator makes a change on that article, after the update we call exactly the same read query with a cachedwithin(0,0,0,0) in order to clear the cached data.

       

      That worked fine until the upgrade to CF 10, when we realized that the calls for cleaning the cached queries were not working. After a lot of testing we noticed that if we call the cleaning cache query withing the readers application scope, then it is correctly erased from the cache for the readers. The exact same query called from administrators scope only clears the cache for the administrators, not the readers.

       

      Reading the cache documentation I have only found references to the different scopes of ehcache, but I don't know if those scopes also applies to the cachedwithin cached queries. Also, supposedly the cache scope by default is server, not application....

       

      So, are the queries cached with cachedwithin cached on an application scope, as it seems? Is there a way to change this in order to make them cached on a server scope? Would be better to migrate to cache functions like cachePut() and cacheRemove()?

       

      Thanks in advance,

       

      (please forgive my poor english, need some more practice at writing...)