Link to home
Start Free TrialLog in
Avatar of Ian White
Ian WhiteFlag for Australia

asked on

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

Avatar of devilJinKazama
devilJinKazama
Flag of Australia image

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?
Avatar of Ian White

ASKER

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
ASKER CERTIFIED SOLUTION
Avatar of devilJinKazama
devilJinKazama
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Not sure what caused the problem. Maybe the query got cached on the server.Resolved the next day
Thanks for you help
thankyou
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">
Thanks but I have never used cachedwithin