Once you put a Drupal app behind layers of external cache, the idea of "most popular" or "most viewed" becomes hard to compute. Boost's excellent boost_stats.php callback tries solves this in some situations by doing a partial bootstrap to access the DB and increment node_counter. But there are at least two potential complications to boost_stats.php with external cache.
- If your site lives behind external cache (e.g., Akamai), the callback paths will get cached. You need to update the CDN config so that it doesn't cache this path, or alter the request (e.g., append a random string to the callback) so that it busts through the cache layers and accesses the Drupal app directly.
- If your site is behind external cache because it sustains high traffic, the last thing you want to do is to cause a database write with every content (page, story, etc.) page load.
I found some inspiration with the recently-announced Pixel Ping, a lightweight pixel-tracker that runs on node.js. The attraction here is that you can run this service from a different (non-cached) domain, load a pixel with each content page load, and have Pixel Ping flush its stats periodically via a REST callback.
Instead of writing to the database on every page view, you can write every, say, 60 seconds. And instead of dealing with your external cache config, you can run this somewhere else entirely.
I have the first draft of a pixel_ping module that provides this integration -- a block to load the pixel, and a REST callback to update the node_counter statistics. The callback reuses code from Boost's boost_stats.php, but deals in batches of statistics instead of individual node_loads.
While I work on building out the configuration options for this, and before I submit a module proposal to d.o, wondering if any of you have caveats, feature requests, or other insight to share.