1 Reply Latest reply on Jan 25, 2013 3:03 PM by BreakawayPaul

    <cffeed> caching works locally but not on server

    BreakawayPaul Level 2

      So I got my new Hostek account set up (woohoo!) and I've started uploading some basic files so I can do thinks like validate my code and make sure everything's working.  One thing that does not work (but does locally) is my news feed caching.

       

      Pulling in two RSS feeds was seriously slowing down my index page loading, so I stole a trick from Ray Camden on caching the feeds.  It works perfectly on my dev machine at home, but doesn't work on my hosted account.

       

      Here's the exact code being used:

      <cfset feedurl = "http://velonews.competitor.com/feed">

      <cfset cacheTime = #createtimespan(1,0,0,0)#>

      <cfif not structKeyExists(application,"rsscache") or dateDiff("n", application.rsscache.created, now()) gt cacheTime>

          <cffeed source="#feedurl#" query="entries">

          <cfset application.rsscache = structNew()>

          <cfset application.rsscache.data = entries>

          <cfset application.rsscache.created = now()>

      </cfif>

      <ul>

      <cfloop query="#application.rsscache.data#" startrow="1" endrow="6">

      <cfoutput><li><a href="#rsslink#">#title#</a></li></cfoutput>

      </cfloop>

      </ul>

       

      I tried wrapping a try/catch around the top section (above the <ul>) and still got nothing for an error message.  The page just stops being rendered at that first <ul>.

       

      I'm not sure why it works locally but not on the web server.  Any ideas?