14 Replies Latest reply on Jan 22, 2008 12:07 PM by BKBK

    Caching a CFHTTP feed into the Application Scope of the Server


      I have the following CFHTTP tag script, how do I check that it is caching this data correctly into the Application scope of the server?

      So that users do not have to access the Internet site to get the feed as the CFHTTP caches the data within the 500 minute timeframe set?

      This is my Application.cfm page

      <CFAPPLICATION NAME="application">

      not structKeyExists(Application, "TimeStamp")
      (dateDiff("n", Application.TimeStamp, now()) gt 500)>

      <cfset Application.TimeStamp = now() />

      <cfhttp url=" http://feeds.bbc.co.uk/weather/feeds/rss/5day/id/3314.xml" method="GET" resolveurl="No"></cfhttp>
      <cfset Application.weather_xml = xmlParse(cfhttp.FileContent) />



      This is the code to output the feed.

      <img src="#application.weather_xml.rss.channel.image.url.xmlText#" alt="#application.weather_xml.rss.channel.item.DESCRIPTION.xmlText#" width="70px" height="70px">


      <cfloop index="x" from="1" to="#ArrayLen(application.weather_xml.rss.channel.item)#">

      #replace(application.weather_xml.rss.channel.item[x].title.xmlText, ',', '<br>', 'ALL')#