* Sysops now have the "suppressredirect" right by default
* (bug 22463) $wgFooterIcons added to allow configuration of the icons shown in
the footers of skins.
+* $wgFileCacheDepth can be used to set the depth of the subdirectory hierarchy
+ used for the file cache. Default value is 2, which matches former behavior
=== New features in 1.17 ===
* (bug 10183) Users can now add personal styles and scripts to all skins via
*/
$wgFileCacheDirectory = false;
+/**
+ * Depth of the subdirectory hierarchy to be created under
+ * $wgFileCacheDirectory. The subdirectories will be named based on
+ * the MD5 hash of the title. A value of 0 means all cache files will
+ * be put directly into the main file cache directory.
+ */
+$wgFileCacheDepth = 2;
+
/**
* Keep parsed pages in a cache (objectcache table or memcached)
* to speed up output of the same page viewed by another user with the
public function fileCacheName() {
if( !$this->mFileCache ) {
- global $wgCacheDirectory, $wgFileCacheDirectory;
+ global $wgCacheDirectory, $wgFileCacheDirectory, $wgFileCacheDepth;
if ( $wgFileCacheDirectory ) {
$dir = $wgFileCacheDirectory;
# Store raw pages (like CSS hits) elsewhere
$subdir = ($this->mType === 'raw') ? 'raw/' : '';
+
$key = $this->mTitle->getPrefixedDbkey();
- $hash = md5( $key );
+ if ( $wgFileCacheDepth > 0 ) {
+ $hash = md5( $key );
+ for ( $i = 1; $i < $wgFileCacheDepth; $i++ ) {
+ $subdir .= substr( $hash, 0, $i ) . '/';
+ }
+ }
# Avoid extension confusion
$key = str_replace( '.', '%2E', urlencode( $key ) );
-
- $hash1 = substr( $hash, 0, 1 );
- $hash2 = substr( $hash, 0, 2 );
- $this->mFileCache = "{$dir}/{$subdir}{$hash1}/{$hash2}/{$key}.html";
+ $this->mFileCache = "{$dir}/{$subdir}{$key}.html";
if( $this->useGzip() ) {
$this->mFileCache .= '.gz';