Skip to content

Add TTL support for function caching#70

Merged
humoflife merged 5 commits intocrossplane-contrib:mainfrom
stevendborrelli:enable-ttls
Aug 20, 2025
Merged

Add TTL support for function caching#70
humoflife merged 5 commits intocrossplane-contrib:mainfrom
stevendborrelli:enable-ttls

Conversation

@stevendborrelli
Copy link
Member

@stevendborrelli stevendborrelli commented Aug 11, 2025

Description of your changes

In Crossplane 1.20, the ability via PR crossplane/crossplane#6422 to cache function outputs was added as an alpha feature with the flag --enable-function-response-cache

This PR implements setting the TTL via the input using the cacheTTL field.

Fixes #

I have:

Signed-off-by: Steven Borrelli <steve@borrelli.org>
Signed-off-by: Steven Borrelli <steve@borrelli.org>
Signed-off-by: Steven Borrelli <steve@borrelli.org>
Copy link
Collaborator

@humoflife humoflife left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cacheTTL functionality is working. However, it appears that with --enable-function-response-cache flag enabled, function-shell with cacheTTL is called every 2 * cacheTTL versus every cacheTTL. When using the default of 1 minute per function-sdk, the function is called once every 2 minutes.

@stevendborrelli
Copy link
Member Author

@humoflife I can check if we are computing the TTL incorrectly

Signed-off-by: Steven Borrelli <steve@borrelli.org>
@stevendborrelli
Copy link
Member Author

I was testing timing in crossplane/crossplane#6718, and it seems to be working correctly on the Crossplane side.

In any case, the function is setting the TTL correctly even if crossplane is computing deadlines incorrectly.

@humoflife humoflife merged commit 109e5e3 into crossplane-contrib:main Aug 20, 2025
6 checks passed
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 this pull request may close these issues.

2 participants