1

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.

3 Answers 3

2

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:

Sign up to request clarification or add additional context in comments.

Comments

1

@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

Comments

0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.