contao/import — Issue #2898: Cached image gets deleted on upload.
Author: tsarma
Created: 2011-11-29 20:28:49+00:00
State: open
Labels: backend, Defect

Hi,

`$this->Automator->purgeHtmlFolder()` inside function `move()` of drivers `DC_Folder.php` file causes broken image in FE if a BE user uploads an image with cache is enabled for a website.

Scenario: Say a website has enabled a cache for 24 hours in the settings. If say page A.html with some images on it is opened in browser. The contao, will cached this page in tmp folder and its images in html folder. Now if a BE user logs in and upload an image with file manager, then `$this->Automator->purgeHtmlFolder()` is called which eventually deletes all the cached images. Under this case if someone else opens A.html before 24 hours of cached expiry time, Contao will serve the cached version of A.html. This cached version of page has all the images with broken link as html folder is cleaned by `purgeHtmlFolder()` function.

Related issues: #556

--- _Originally created on February 28th, 2011, at 02:28pm (ID 2898)_