{"record":{"id":"9d3579de4424ebe4","repo":"octobercms/october","slug":"the-resizer-file-name-is-not-found","errorCode":null,"errorMessage":"The resizer file ':name' is not found.","messagePattern":"The resizer file ':name' is not found\\.","errorType":"exception","errorClass":"ApplicationException","httpStatus":null,"severity":"error","filePath":"modules/system/classes/ResizeImages.php","lineNumber":130,"sourceCode":"        // Force immediate processing if requested\n        if ($imageItem->options['force'] ?? false) {\n            $this->processImage($cacheKey);\n            return $this->getPublicPath($imageItem);\n        }\n\n        $outputFilename = $imageItem->getCacheVersion();\n\n        return $this->getResizedUrl($outputFilename);\n    }\n\n    /**\n     * getContents performs the resize and stores in on disk, creating a cache\n     */\n    public function getContents($cacheKey)\n    {\n        $cacheInfo = $this->getCache($cacheKey);\n        if (!$cacheInfo || !isset($cacheInfo['path'])) {\n            throw new ApplicationException(__(\"The resizer file ':name' is not found.\", ['name' => e($cacheKey)]));\n        }\n\n        $this->processImage($cacheKey);\n\n        $imageItem = (new static::$imageItemClass)->fromCacheInfo($cacheKey, $cacheInfo);\n\n        return Redirect::to($this->getPublicPath($imageItem));\n    }\n\n    /**\n     * processImage performs the resize and stores it on disk\n     */\n    protected function processImage($cacheKey): void\n    {\n        $cacheInfo = $this->getCache($cacheKey);\n        if (!$cacheInfo || !isset($cacheInfo['path'])) {\n            return;\n        }","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/system/classes/ResizeImages.php#L112-L148","documentation":"ResizeImages::getContents($cacheKey) is the handler behind resizer URLs: it looks up the stored resize descriptor via getCache($cacheKey). Resized image URLs are only valid while their cache record exists; when the entry (or its 'path' key) is gone, an ApplicationException with the cache key in the message is thrown instead of an image. The URL itself embeds the cache id, so any consumer holding a stale URL (page cache, CDN, hardcoded markup) breaks after the cache is flushed or expires.","triggerScenarios":"GET to the resizer route (SystemController::resize / ResizeImages::getContents) with a cache id whose entry was evicted: TTL lapse, `php artisan cache:clear`, cache store switch (file->redis), or an environment deployed with a cold cache while HTML still references old resizer URLs.","commonSituations":"Full-page cache or CDN still serving HTML with old resizer URLs after a deploy flushed the app cache; switching cache stores during scaling; long-lived external links (emails, PDFs) embedding resizer URLs.","solutions":["Regenerate the page/markup so the `|resize` twig filter emits fresh resizer URLs derived from the current cache","Purge CDN and full-page caches whenever you flush the application cache","Increase the TTL of the cache store used by the resizer if resize descriptors expire too quickly","Never hardcode resizer URLs; always generate them from the source file/model at render time"],"exampleFix":"// before — hardcoded / stale resizer URL in a template or email\n<img src=\"{{ 'public/uploads/photo.jpg'|resize(800, 600) }}\">…cached for weeks → 500 after cache:clear\n// after — always render from the source so the URL is regenerated per page render\n<img src=\"{{ record.photo|resize(800, 600) }}\" alt=\"\">","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    $resized = (new \\System\\Classes\\ResizeImages)->getContents($cacheKey);\n} catch (\\October\\Rain\\Exception\\ApplicationException $ex) {\n    // cache record gone — fall back to the original, unresized source\n    return \\Redirect::to($originalImageUrl);\n}","preventionTips":["Generate resizer URLs at render time via the `|resize` filter instead of storing them","Purge CDN / full-page caches together with the application cache, never separately","Keep resizer cache TTL longer than any page-cache TTL that embeds its URLs"],"tags":["octobercms","image","resize","cache","expired-cache"],"backgroundTag":"cache-miss","analyzedSha":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}