#6450 [Core feature] Ability to set TTL on cache entries
Issue created by
Sovietaced
### Motivation: Why do you think this is important?
We have lifecycle policies configured for the underlying cache storage layer (S3). When the underlying cache storage is deleted we are left with dangling pointers in Flyte Datacatalog. When Flyte Datacatalog attempts to retrieve these cache entries it encounters an internal error.
It would be nice if users could set the TTL of cache entries in Flyte Datacatalog. Additionally, it would be nice if Flyte Datacatalog had a background task or cron job that could periodically delete these entries from the database along with their related underlying storage. This would prevent Flyte Datacatalog entries from growing indefinitely for folks that don't have unlimited database storage.
### Goal: What should the final outcome look like, ideally?
cache=fl.Cache(version="1.1", ttl=datetime.timedelta(days=30))
def bar(df: pandas.DataFrame) -> int:
...
### Describe alternatives you've considered
Another solution that might also be worthwhile exploring is making the behavior of flytecatalog configurable when the underlying storage layer is deleted. The downside to this approach is that it may make it hard to discern situations where the data should be there and when the data should not be there.
### Propose: Link/Inline OR Additional context
No response
### Are you sure this issue hasn't been raised already?
• Yes
### Have you read the Code of Conduct?
• Yes
flyteorg/flyte