Skip to content

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

Open
@aSemy

Description

@aSemy

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_

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions