friendica/friendica — pull request #343 by rdc (2012-06-19 19:59:18+00:00)
Title: Added caching of profile image revisions. Added profile image revisions usage in friend requests.

Added the get_cached_avatar_image function to App class.

App::get_cached_avatar_image caches profile image revision requests on a per instance basis.

App::get_cached_avatar_image avoids the need to add resource hungry JOIN statements to various different sql queries. It also minimizes the number a database queries needed to retrieve all profile image revisions for any given page.

The App class seemed like the most logical place to put get_cached_avatar_image since it is easily accessible by all functions that require profile images. Alternatively, the get_cached_avatar_image function could be moved to some singleton class that contains utility functions.

I have restored all of the sql queries that I added JOINs to in my previous Pull Request and added calls to App::get_cached_avatar_image to those functions instead.

- rdc