-
Type:
Bug
-
Status: Closed
-
Resolution: Fixed
-
Affects Version/s: 7.0.X, 7.1.X, 7.2.X, Master
-
Fix Version/s: 7.0.0 DXP FP86, 7.0.10.12 DXP SP12, 7.0.X, 7.1.10 DXP FP14, 7.1.X, 7.2.10 DXP FP1, 7.2.X, 7.2.1 CE GA2, 7.3.10 DXP GA1, Master
-
Component/s: External Document Repositories
-
Branch Version/s:7.2.x, 7.1.x, 7.0.x
-
Backported to Branch:Committed
-
Story Points:1
-
Fix Priority:2
-
Sprint:031 - Nidoqueen
-
Git Pull Request:
Background
When using S3, uploaded documents and generated previews are stored as cache in <tomcat_home>/temp/liferay/s3 directory.
- generated previews are stored in a sub-folder:
- master/72x: adaptive/
- 71x: document_thumbnail/
Cache files are cleaned, based on the "Cache Directory Clean Up Expunge" and "Cache Directory Clean Up Frequency" configuration options, in System Settings.
See this KB for more details:
https://help.liferay.com/hc/ja/articles/360017899351-Optimizing-S3Store-Cache-Settings
Issue
Cache files that are expected to be expired, are not getting removed.
Steps to Reproduce
- Start Liferay
- Configure Liferay to use S3 Store
- Configure S3 Store Cache properties in System Settings:
- Cache Directory Clean Up Expunge = 1
- Cache Directory Clean Up Frequency = 1
- Reference: Liferay Help Center - Optimizing S3Store Cache Settings
- Note that <tomcat_home>/temp/liferay/s3 does not exist
- Go to Documents and Media
- Upload a new image
- Click Save
- Refresh Documents and Media page
- Notice that the following folders and files are created, based on the current date (e.g. 07-17-2019)
- Cache File:
- <tomcat_home>/temp/liferay/s3/2019/07/17/07/1021563349685000
- Thumbnail Folder:
- <tomcat_home>/temp/liferay/s3/2019/07/17/07/adaptive/Preview-1000x0/
- Thumbnail File:
- <tomcat_home>/temp/liferay/s3/2019/07/17/07/adaptive/Preview-1000x0/20142/206/30926/30927.png1563349712000
- Cache File:
- Logout
- Change the OS date to fast-forward time to 2 days ahead (e.g. 7/17 to 7/19)
- Log back in
- Go to Documents and Media page again
- Notice the following observations:
- A New thumbnail cache file is created for the different "day" and with the same name:
- Thumbnail File:
<tomcat_home>/temp/liferay/s3/2019/07/19/07/adaptive/Preview-1000x0/20142/206/30926/30927.png1563349712000
- Thumbnail File:
- The Old thumbnail cache folder/file(s) from the previous day has been removed:
- Thumbnail Folder:
- <tomcat_home>/temp/liferay/s3/2019/07/17/07/adaptive/Preview-1000x0/
- Thumbnail File:
- <tomcat_home>/temp/liferay/s3/2019/07/17/07/adaptive/Preview-1000x0/20142/206/30926/30927.png1563349712000
- Thumbnail Folder:
- The Old Cache File has not been removed:
- Cache File:
- <tomcat_home>/temp/liferay/s3/2019/07/17/07/1021563349685000
- Cache File:
- A New thumbnail cache file is created for the different "day" and with the same name:
Actual behavior
The Original Cache File is not removed (only the Original Thumbnail Folder/File(s) have been removed)
Expected behavior
Both the Old Cache File and Old Thumbnail Folder/File(s) are removed