Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Introduce response based cache expiry#15

Open
kevinmade wants to merge 3 commits into
saloonphp:v3 from
kevinmade:feature/resolve-cache-expiry
Open

Introduce response based cache expiry #15
kevinmade wants to merge 3 commits into
saloonphp:v3 from
kevinmade:feature/resolve-cache-expiry

Conversation

@kevinmade

@kevinmade kevinmade commented Sep 11, 2025

Copy link
Copy Markdown

No description provided.

@JonPurvis JonPurvis left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Great implementation!

I had one question regarding resolveCacheExpiry() which I've commented in the file.

Other than that, could you add some tests that:

  • Cover DateTimeImmutable being returned
  • Assert the cached entry is written with the correct expiry
  • Any edge cases in resolveCacheExpiry such as 0, negative, date in the past

Thanks!

Comment thread src/Contracts/Cacheable.php

Copy link
Copy Markdown

Thanks for taking a look at my feedback, I'll get round to giving this a look over later this week / early next week. If it's all good, we can get it merged and get a new release out!

@JonPurvis JonPurvis left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍 Looks good to me.

I'll speak with @Sammyjo20 next week (if not before) to see if he's happy to get this merged and arrange a release of this package!

Thanks for your work on this!

Copy link
Copy Markdown
Member

The PR looks good to me but it still looks like it would be a breaking change because we're completely removing the cacheExpiryInSeconds method and changing it to resolveCacheExpiry which no one would have implemented, so updating the package would break it for their existing implementations.

Copy link
Copy Markdown

Hey @Sammyjo20

We could perhaps release this as v4? We'd need a short upgrade guide somewhere though!

Sammyjo20 reacted with thumbs up emoji

Copy link
Copy Markdown
Author

@Sammyjo20 Do you already have a rough idea for when v4 is planned to be released?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

1 more reviewer

@JonPurvis JonPurvis JonPurvis approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /