I know my last reply was a little outside of what you asked about, but
in my opinion, it's still the best way to go to reduce your server
load and, just as importantly, that of the host server.  Here's a
quick snippet I've used:

cfhttp  url="#variables.feedURL#"
                method="GET"
                useragent="[identify your application here]"
                throwonerror="yes"
                charset="#variables.feedcharset#"
>
        <cfhttpparam    type="header"
                        name="If-None-Match"
                        value="#variables.feed.Etag#"
        />
        <cfhttpparam    type="header"
                                name="If-Modified-Since"
                                value="#variables.feedHTTPLastModified#"
/>
</cfhttp>

Each time I retrieve feed content, I store the value of the ETag
header (if any) and I store the last modified header value.  The next
time I retrieve the feed, content is only retrieved if there are no
changes.  You can access these values as #cfhttp.responseHeader#.

In the USERAGENT attribute, I like to identify my application.  If a
feed provider sees that, for some reason, I'm abusing his or her
server s/he can ignore requests from my application.  Again, it's just
an attempt to be polite.  I've never had any trouble.

Hope this helps.

On 8/24/06, Ian Vaughan <[EMAIL PROTECTED]> wrote:
> How would I cache these xml feed requests, so it does not need to make a
> request every time the page is called ?
>
> I have tried using
>
> <cfcache action="cache" timespan="#createTimeSpan(0,0,20,0)#">
>
> But as the page is using a user login system i.e.
>
> <CFIF IsDefined("Session.username") AND IsDefined("Session.Password")
> AND IsDefined("Session.ID")>
>
> --- page code ---
>
> <CFELSE>
> <!--- If the session is not active then the user is directed to the
> login page --->
> <CFLOCATION URL="../login.cfm" ADDTOKEN="No">
> </CFIF>
>
> The page will not load, I am not getting any error, the page is
> redirecting back to the login screen?
>
> Could it be to do with the cfcache not liking the session variables??
>
> -----Original Message-----
> From: Rob Wilkerson [mailto:[EMAIL PROTECTED]
> Sent: 23 August 2006 17:23
> To: CF-Talk
> Subject: Re: Parsing an XML Feed
>
> Yep.  Both work just fine for me.  One other thing to look for...if
> you're using a DevNet version of ColdFusion then it may be inserting an
> errant <meta> tag that causes all kinds of havoc when dealing with XML.
>
> On 8/23/06, Ian Vaughan <[EMAIL PROTECTED]> wrote:
> > Hi Rob
> >
> > How about these feeds, do you get these to work for you ?
> >
> > http://www.vnunet.com/feeds/rss/latest/all/analysis
> >
> > http://www.vnunet.com/feeds/rss/computing
> >
> > I am getting the error
> >
> > An error occured while Parsing an XML document.
> > Content is not allowed in prolog.
> >
> >
> >
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:250843
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to