Cache files do not fully get deleted
Bug Report
Current Behavior
I use the extension version 15.1.2 in a project. The extension configuration enableGeneratorPlain and enableGeneratorGzip are active. When the extension is activated and e.g the startpage of the website is called, the typo3temp/assets/tx_staticfilecache/sitename/ directory contains the expected files for the startpage:
.htaccesswith header declarationsindexwhich includes the uncompressed HTML output of the pageindex.config.jsonindex.gzwhich includes the compressed HTML output of the page
So far, so good - everything seem to work.
The startpage has a news plugin, which shows news articles from a given folder. In the background, a scheduler tasks imports/updates news articles every 10 minutes. The scheduler tasks uses TYPO3 DataHandler to import/update the news articles, so TYPO3 cache handling is processed by DataHandler. When a news article is imported/updated, the cache files from ext:staticfilecache for the startpage of the website are expected to be removed. This is however not always the case, and sometimes, the index file remains. This agains leads to the situation, that no .htaccessfile is present and the content of the indexfile is delivered as is to the client without any content-type HTTP header resulting in the browser showing the content as is.
I spent hours in debugging the problem locally, but was unable to reproduce the problem. On the production webserver, the problem can be reproduced some times, but not always with the result, that files remain. Sometimes, the .htaccess file and the index file remain.
The webserver has an virus scan component active, so maybe there is some kind of file locking active. But if this is the source of the problem, I would at least expect some type of error somewhere indicating, that the cache files could not be removed. But logs contain no type of information about this.
What could be reasons for the cache files not being removed properly?
Environment
- TYPO3 version: 12.4.latest
- staticfilecache version: 15.1.2
- Is your TYPO3 installation set up with Composer (Composer Mode): yes
- OS: i think it is SLES, but I'm not sure, since I do not have shell access
Hey @derhansen ,
thanks for the detailed explanation. Sounds "strange". All files are deleted via this Service:
- https://github.com/lochmueller/staticfilecache/blob/main/Classes/Generator/AbstractGenerator.php#L33
- https://github.com/lochmueller/staticfilecache/blob/main/Classes/Service/RemoveService.php#L41
Perhaps you could check, if the file still exists, after the "unlink"? Do you also check the rights of the files (looks good?)? I also check the changes from 15.1.2 to 15.2.2 ( https://github.com/lochmueller/staticfilecache/compare/15.1.2...15.2.2 ) but there are no related changes to your problem :-/ Do you think it is related to the News detail page on the page or do you found the problem also on regular pages?
So, current state: I have no idea ;)
Perhaps I can create a test case in the next days.
Regards, Tim
@lochmueller The website where the problem occured will get a major update the next few months and the DataHandler Sync job will vanish. So I will not be able to dig deeper into the problem and will close this issue now. Most likely, the problem may have been cause by some webserver setup (e.g. virus scanner with file locks).