Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set custom-time when a cache entry is read or written, so I can expire unused entries #47

Open
aSemy opened this issue Mar 16, 2024 · 0 comments · May be fixed by #58
Open

Set custom-time when a cache entry is read or written, so I can expire unused entries #47

aSemy opened this issue Mar 16, 2024 · 0 comments · May be fixed by #58

Comments

@aSemy
Copy link
Contributor

aSemy commented Mar 16, 2024

I would like to be able to set a lifecycle policy for my GCP bucket that expires entires by when they were last used.

Deleting old items is beneficial because it means that the storage does not constantly expand. However, a basic "delete items by created age" policy might delete entries that are still used. Expiring entries by their unused date would be beneficial, because it's possible that even if an entry is old, it might still be used. This would avoid cache misses.

As I understand, such a policy is possible with a daysSinceCustomTime lifecycle condition, but it requires that the Custom-Time field is set.

Would it be possible for gcp-gradle-build-cache to set Custom-Time when an entry is saved, and successfully read?

https://cloud.google.com/java/docs/reference/google-cloud-storage/latest/com.google.cloud.storage.Blob.Builder#com_google_cloud_storage_Blob_Builder_setCustomTimeOffsetDateTime_java_time_OffsetDateTime_

@aSemy aSemy linked a pull request Jun 21, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant