Request-local caching of DjVu dimensions
authorOri Livneh <ori@wikimedia.org>
Wed, 23 Mar 2016 19:37:01 +0000 (12:37 -0700)
committerOri Livneh <ori@wikimedia.org>
Wed, 23 Mar 2016 23:28:29 +0000 (16:28 -0700)
Make DjVuHandler::getDimensionInfo() cache dimension info in memory so that
operations which get the dimensions of each page don't result in multiple
round-trips to memcached.

Change-Id: Idbd11637a8f7d87e4774f76a5b90d7469f3b0857

includes/media/DjVu.php

index d4ef8a8..cd249a8 100644 (file)
@@ -419,7 +419,8 @@ class DjVuHandler extends ImageHandler {
                                }
 
                                return [ 'pageCount' => $count, 'dimensionsByPage' => $dimsByPage ];
-                       }
+                       },
+                       [ 'pcTTL' => WANObjectCache::TTL_INDEFINITE ]
                );
        }