I want to caching some response with symfony\\cache. But I\'ve got some error with my cache and sometime with the symfony default cache.
Configuration :
Deb
If you happened to use FAT/FAT32 or another file system with severely limited timestamp range, then that warning is to be expected.
Symfony's FilesystemCommonTrait::write() method calls touch() function with unix timestamp 0 to force expire cached content. Unix timestamp 0 represents 1970-01-01 date. In FAT file system the allowed timestamp range is 1980-01-01 to 2099-12-31, according Wikipedia. So the touch() function fails and a warning is issued.
The workaround is to modify the FilesystemCommonTrait::write() method, around line 80.
Find lines:
if (null !== $expiresAt) {
touch($this->tmp, $expiresAt);
}
Insert before those lines:
if (0 === $expiresAt) {
$expiresAt = time() - 1;
}
This should achieve virtually the same result by instantly expiring the cached content, but without using an invalid file system timestamp.
Alternatively, change the file system type.