Installation

Usage

Cache

SocialShare relies on the Doctrine Cache library to store data retrieved from social networks.
Doctrine Cache supports a lot of caching systems including but not limited to file, Memcache, MongoDB, Redis and APC.
Use the one that suit your needs.

Delayed updates

When the third parameter of the \SocialShare\SocialShare::getShares() method is set to true, the number of share counts is never retrieved from social networks:
If a value is already in the cache (how old it is doesn't matter) it is used, otherwise 0 is returned

To force the update of share counts, the \SocialShare\SocialShare::update() method must be called.

Thanks to this tweak, HTTP requests retrieving shares counts from social networks will be issued after the page load.
Of course, only the next visitor will see updated counts, but it allows fast pages load even in the worst case: when the data must be updated from social networks servers.