[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 203
  • Last Modified:

cached page coldfusion

I keep getting an old search result/query from coldfusion from browser. Another computer gets the new result for same search.  I clear browser cache did not help

Put this in header and still did not help
<cfheader name="cache-control" value="no-cache, no-store, must-revalidate">
 <cfheader name="pragma" value="no-cache">
 <cfheader name="expires" value="#getHttpTimeString(now())#">
 
Thanks

0
Ian White
Asked:
Ian White
  • 4
  • 3
1 Solution
 
devilJinKazamaCommented:
queries cannot be cached in the browser. you can cache resultsets in coldfusion using the cachedwithin or cachedafter parameters.

so if you are seeing different result sets , could be because different queries are being executed per session?

try dumping the queries and analyzing the results. also if you check debugging do the queries look the same on the two browsers?
0
 
Ian WhiteAuthor Commented:
I have coldfusion only on the server not on my PC  How do I turn on debugging so I can see the
code executing - not for production just testing  I have a /test  directory for testing

Thanks
Ian
0
 
devilJinKazamaCommented:
i assume you have access to the administrator.

in the left menu bar you can see the 'Debugging and logging' section, in there you can go to 'debug output settings' and turn on the 'enable request debugging output' but make sure you add your IP first in the 'debugging IP addresses' section. if there are no ips there then CF will display debugging to all requests when turned on. after you add  your ip you should be able to see the debugging on your requests

once you have the debugging up and running, have a look at the two queries in the different browsers to see if they are the same, return the same amount of rows etc
0
[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

 
Ian WhiteAuthor Commented:
Not sure what caused the problem. Maybe the query got cached on the server.Resolved the next day
Thanks for you help
0
 
Ian WhiteAuthor Commented:
thankyou
0
 
devilJinKazamaCommented:
happy to help, or in this case try to help  :-)

if it was cached by CF, your code would look something like this

<cfquery name="foo" datasource="foo" cachedwithin="#createtimespan(1,0,0,0)#">

meaning cache the query for a day and re-run

if you want that not to happen simply remove the cachedwithin parameter

<cfquery name="foo" datasource="foo">
0
 
Ian WhiteAuthor Commented:
Thanks but I have never used cachedwithin

0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now