views:

31

answers:

3

Hey guys,

I have to load some XML data (generated from a database, using PHP) into a flash slideshow. The database data will change only when someone edit the website at it's backend.

In terms of loading speed and performance, which is best:

1) Generate the XML data dynamically from the database, each time the page is loaded;

2) Generate a .XML file whenever the database is updated, which will be read by the flash file.

+2  A: 

The fastest is likely

3) use Memcached

Otherwise it is likely 2 because connecting to a database is usually a bottleneck and often slower than file I/O. But then again, you could simply benchmark it to see which works best for you. That's much better than assuming.

Also, have a look at this related question:

Gordon
A: 

I think got for 1) Generate the XML data dynamically from the database, each time the page is loaded; is a good choice as its its normal as html. coz i think writing file always need more resource.

it depend on how your code is , if your code is processing alot of data every time, then writing file make sense

JapanPro
+1  A: 

@JapanPro He wouldn't need to write to the XML file when it was requested, just when someone saved something to the database. This would mean a much better load speed compared to pulling data from a database everytime.

Of course it depends how much data we're talking and whether it's worth writing to a file first. As @Gordon said, run some tests to see which works better for you

Alex