I have been a CFer for a while and am dipping my toe into the
Spry/AJAX world. What I am attempting to do is not only learn
Spry/AJAX to develop RIAs, but go down the AIR path. I do nto know
if this is the right place to ask this, but here goes...
I hav a SQL database that contains the data for my app. If I
were simply developing a CF app, I would just use a basic cfquery
statement. In order to get an XML file out of the SQL database for
my Spry/AJAX app, I built a file using the cfxml tag. It worked
great, but my only concern is the refreshing of the XML file from
the SQL database. What is the standard best practive to get this
done? Do I call a CFschedule tag? Call the cfxml tag to run or
what? I want to make sure my end users have the most upto date XML
data as possible.
I would suggest you to use your .CFM file to output xml data
dynamically to clients. You can use use <cfcontent
type="text/xml" reset="yes"> to specify the content type of your
.CFM file as XML. This way your xml is a dynamic one, as opposed to
a static xml.
Do not use <cfsavecontent> to write it to disk - disks
operations are always slower. Simply, send the data back to client.
For caching purpose, consider using cachedWithin attribute of
<cfquery> tag - this will take care of your page's
performance.
Sam Adobe Certified Flash and
Advanced ColdFusion Developer
Allow me to explain some more. I can generate the XML with
CF. What my question is...how do I have the CF code generate the
XML when the app is instantiated using Spry? I want to make sure
the XML is as up to date from the SQL database as possible.