| @@ -86,8 +86,12 @@ | ||
| 86 | 86 | return null; |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | $path = '' === implode( '/', $segments ) ? '/' : '/' . implode( '/', $segments ) . '/'; |
| 90 | + // The tree stores decoded names (Cache::static_path()). Encode them | |
| 91 | + // back the way a permalink is spelled, so the row merges with the | |
| 92 | + // flat entry's canonical URL instead of listing the page twice. | |
| 93 | + $path = Cache::normalize_path( $path ); | |
| 90 | 94 | |
| 91 | 95 | return ( $https ? 'https://' : 'http://' ) . $host . $path; |
| 92 | 96 | } |
| 93 | 97 | |
| @@ -142,9 +146,12 @@ | ||
| 142 | 146 | $merged = array(); |
| 143 | 147 | |
| 144 | 148 | foreach ( $rows as $row ) { |
| 145 | 149 | $url = isset( $row['url'] ) && is_string( $row['url'] ) ? $row['url'] : null; |
| 146 | - $key = null !== $url ? 'u:' . $url : 'p:' . (string) ( $row['path'] ?? '' ); | |
| 150 | + // A flat entry's URL comes from the page's canonical link, which | |
| 151 | + // may carry either escape case; compare in the cache key's one | |
| 152 | + // spelling so a page's flat and static copies stay one row. | |
| 153 | + $key = null !== $url ? 'u:' . Cache::normalize_path( $url ) : 'p:' . (string) ( $row['path'] ?? '' ); | |
| 147 | 154 | |
| 148 | 155 | if ( ! isset( $merged[ $key ] ) ) { |
| 149 | 156 | $merged[ $key ] = $row; |
| 150 | 157 | continue; |
| @@ -397,8 +404,10 @@ | ||
| 397 | 404 | self::add_glob( $buckets['assets'], XSPEED_CACHE_DIR . '/min/*.css' ); |
| 398 | 405 | self::add_glob( $buckets['assets'], XSPEED_CACHE_DIR . '/min/*.js' ); |
| 399 | 406 | self::add_glob( $buckets['assets'], XSPEED_CACHE_DIR . '/min/combined/*.css' ); |
| 400 | 407 | self::add_glob( $buckets['assets'], XSPEED_CACHE_DIR . '/min/combined/*.js' ); |
| 408 | + // One manifest per minified source, per blog (Asset_Manifest). | |
| 409 | + self::add_glob( $buckets['metadata'], XSPEED_CACHE_DIR . '/min/manifests/*/*.json' ); | |
| 401 | 410 | } |
| 402 | 411 | |
| 403 | 412 | if ( defined( 'XSPEED_CACHE_STATIC_DIR' ) && is_dir( XSPEED_CACHE_STATIC_DIR ) ) { |
| 404 | 413 | $static = self::measure_static( XSPEED_CACHE_STATIC_DIR ); |