Tuning Hints

Here are some hints on how to gain (or fake) some performance:

  • Never include all details possible into one page - stick to necessary details and/or split up information to multiple pages
  • If you ignore this, you can at least put a flush(); statement once upon a while - so the user sees some progress (see sample imdb.php)
  • Use the cache - this speeds up subsequent requests for the same movie. Set the cache expiry to something useful - a too large value will fill your disk and ignore possible updates at the IMDB site, a too low value will be bad for the performance. A suitable value is very subjective, but can probably be anything between one hour and one day.
  • If possible, group requests by their respective pages - so they can use the already set-up internal variables instead of reparsing. As for performance, if on the first "click" you retrieve items from different pages, and on a second "click" again, this will be slower as if sticking to groups for each "click" (ahw, how to describe that?!?)
  • If you will need the just retrieved information on a later page, store them locally (e.g. in your own database, in a PHP session variable, or the like). Accessing that information will probably be faster than a re-parse (for sure if you turned the cache off).
Last modified by izzy, 02/25/09 16:43:17 (17 months ago)