Use Cases
Here are a few use cases to review before configuring your OSGi parameters to avoid purging all versions of a page.
minNumberVersions | maxAgeDays | maxNumberVersions | Result |
---|---|---|---|
0 | -1 | 10 | Even if there are 10 versions older than 1 day, this configuration purges all versions. This is because minNumberVersions is set to 0 (or less than 1), indicating that all versions should be purged. The maxNumberVersions parameter becomes irrelevant when no age limit is set). |
0 | 10 | 10 | If all versions are older than 10 days and the minNumberVersions parameter is not specified, all versions are purged because none are within the 10-day limit.If there are 5 versions less than 10 days, 10 versions older than 10 days, and minNumberVersions=0, five versions are retained. |
0 | 10 | 0 | If all versions are older than 10, all versions are purged because there is no minimum number of versions to be retained. And there is no maxNumberVersions in this case either. Even if there were 5 versions less than 10 days, all versions would be purged. |
-1 | -1 | 10 | This setting purges all versions because there is no minimum number of versions to be retained. The maxNumberVersions parameter becomes irrelevant when no age limit is set. |
-1 | 10 | 10 | If all versions are older than 10 days, all versions are purged because there is no minimum number of versions to be retained. The maxNumberVersions parameter becomes irrelevant when there are no versions less than or equal to 10 days.If there are 5 versions less than 10 days, 10 versions older than 10 days, and minNumberVersions=0 , only the 5 versions lesser than 10 days are retained. |
-1 | 10 | 0 | If all versions are older than 10 days, all versions are purged because there is no minimum number of versions to be retained. The maxNumberVersions parameter is irrelevant in this case.If there are 5 versions less than 10 days, 10 versions older than 10 days, and minNumberVersions=0 , then 5 versions are retained. |
5 | 10 | 5 | If all 5 versions are older than 10 days, all 5 versions are retained because minNumberVersions is set to 5.If there are 25 versions older than 10 days, only the last 5 versions are retained because both min and max are set to 5. |
5 | 10 | 10 | If there are 5 versions within 10 days and 10 versions older than 10 days (total 15 versions), the last 10 versions are retained because minNumberVersions is set to 5 and maxNumberVersions is set to 10. Here, both min and max parameters are important. |
Related Reading
3d58f420-19b5-47a0-a122-5c9dab55ec7f