<cffeed> caching works locally but not on server
so got new hostek account set (woohoo!) , i've started uploading basic files can thinks validate code , make sure everything's working. 1 thing not work (but locally) news feed caching.
pulling in 2 rss feeds slowing down index page loading, stole trick ray camden on caching feeds. works on dev machine @ home, doesn't work on hosted account.
here's 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 try/catch around top section (above <ul>) , still got nothing error message. page stops being rendered @ first <ul>.
i'm not sure why works locally not on web server. ideas?
miraculously, got working.
i changed this:
<cfloop query="#application.rsscache.data#" startrow="1" endrow="6">
<cfoutput><li><a href="#rsslink#">#title#</a></li></cfoutput>
</cfloop>
to this:
<cfoutput maxrows="6" query="application.rsscache.data">
<li><a href="#rsslink#">#title#</a></li>
</cfoutput>
and bingo! worked. perhaps it's idiosyncrasy between cf9 , cf10.
More discussions in ColdFusion
adobe
Comments
Post a Comment