Skip to content

Add TTL support for function caching #70

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

stevendborrelli
Copy link
Collaborator

@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 <[email protected]>
Signed-off-by: Steven Borrelli <[email protected]>
Signed-off-by: Steven Borrelli <[email protected]>
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
Collaborator Author

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

Signed-off-by: Steven Borrelli <[email protected]>
@stevendborrelli
Copy link
Collaborator 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.

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