objectcache: add and use adaptiveTTL() method
authorAaron Schulz <aschulz@wikimedia.org>
Sun, 21 Aug 2016 21:53:55 +0000 (14:53 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Wed, 31 Aug 2016 03:40:56 +0000 (03:40 +0000)
commit52511952de7b716e3e7771366852170049afb072
treefae904c1687fa4606ff2e84d5f591b81491bfaf9
parent15a31d40abfeace6b3aab50b4c0e232ea8c82b61
objectcache: add and use adaptiveTTL() method

* This better handles delayed/lost cache purges by
  having lower TTLs for entries that often changes.
* Use this for foreign upload description page caches,
  we purges are never received from the source wiki.
* Also use this for User and LocalFile cache TTLs.
* Also move the Database::getCacheSetOptions() call in
  User *before* doing the queries, which is preferred.
* Fixed some IDEA errors too, like the undeclared
  mApiBase field.

Change-Id: I70f8ebb29ac853c2a530d9eedb9e7facc1b7b710
includes/HttpFunctions.php
includes/filerepo/ForeignAPIRepo.php
includes/filerepo/file/LocalFile.php
includes/libs/objectcache/WANObjectCache.php
includes/user/User.php
tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php