Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9021273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:13:05+00:00 2026-06-16T05:13:05+00:00

I posted a similar question over on the Adobe Community forums, but it was

  • 0

I posted a similar question over on the Adobe Community forums, but it was suggested to ask over here as well.

I’m trying to cache distinct queries associated with a particular database, and need to be able to flush all of the queries for that database while leaving other cached queries intact. So I figured I’d take advantage of ColdFusion’s ehcache capabilities. I created a specific cache region to use for queries from this particular database, so I can use cacheRemoveAll(myRegionName) to flush those stored queries.

Since I need each distinct query to be cached and retrievable easily, I figured I’d hash the query parameters into a unique string that I would use for the cache key for each query. Here’s the approach I’ve tried so far:

  1. Create a Struct containing key value pairs of the parameters (parameter name, parameter value).
  2. Convert the Struct to a String using SerializeJSON().
  3. Hash the String using Hash().

Does this approach make sense? I’m wondering how others have approached cache key generation. Also, is the “MD5” algorithm adequate for this purpose, and will it guarantee unique key generation, or do I need to use “SHA”?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T05:13:06+00:00Added an answer on June 16, 2026 at 5:13 am

    UPDATE: use cacheRegion attribute introduced in CF10!

    http://help.adobe.com/en_US/ColdFusion/10.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7fae.html

    Then all you need to do is to specify cachedAfter or cachedWithin, and forget about how to to generate unique keys. CF will do it for you by ‘hashing’:

    • query “Name”
    • SQL statement
    • Datasource
    • Username and
      password
    • DBTYPE

    reference: http://www.coldfusionmuse.com/index.cfm/2010/9/19/safe.caching

    I think this would be the easiest, unless you really need to fetch a specific query by a key, then u can feed your own hash using cacheID, another new attribute introduced in CF10.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've posted similar question here , but it was closed because I didn't explained
I'm trying to solve interviewstreet's median challenge. I saw a similar question posted here:
[I posted a similar question on serverfault.com, but had very little feedback so trying
My question is similar to a question previously posted but never really answered here:
I have already posted something similar here but I would like to ask the
i have already posted a similar question here, but failed to get a response
Before I post this question, I found somehow similar question posted here . But
There was a similar question posted asking in general about alternatives to Qt. Well,
I saw a similar question being posted here, yet it did not help me
I've seen a very similar question was posted but his solution didn't help. I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.