2 ms·
it takes around 10 seconds to load all the data, which isn't really reducible by much time Is it possible to cache the data? Even for something like news, sto
by byoung2 16y ago
it takes around 10 seconds to load all the data, which isn't really reducible by much time
Is it possible to cache the data? Even for something like news, stocks, or Twitter streams, the data probably doesn't need to be absolutely real-time. Static caching at 5 or 10 minute intervals shouldn't affect the freshness of the data (especially for non logged-in users), and your page will load a lot faster (likely 1-2 seconds at most).
Look into a caching proxy like Varnish to achieve this. Here's a setup I use in most apps:
Database: read from slaves, write to replication cluster
Memcached on database queries (tune timeout based on query type)
Static caching in application layer (e.g. Smarty or Symfony caching)
Varnish caching in front of app server
CDN for images, javascript, etc