-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add caching #56
Add caching #56
Conversation
public function with( | ||
int|null|false $maxAge = false, | ||
int|null|false $sMaxAge = false, | ||
bool|null $noCache = null, | ||
bool|null $mustRevalidate = null, | ||
bool|null $proxyRevalidate = null, | ||
bool|null $noStore = null, | ||
bool|null $public = null, | ||
bool|null $immutable = null, | ||
int|null|false $staleWhileRevalidating = false, | ||
int|null|false $staleIfError = false, | ||
): self { | ||
return new self( | ||
maxAge: $this->withInt($this->maxAge, $maxAge), | ||
sMaxAge: $this->withInt($this->sMaxAge, $sMaxAge), | ||
noCache: $this->withBool($this->noCache, $noCache), | ||
mustRevalidate: $this->withBool($this->mustRevalidate, $mustRevalidate), | ||
proxyRevalidate: $this->withBool($this->proxyRevalidate, $proxyRevalidate), | ||
noStore: $this->withBool($this->noStore, $noStore), | ||
public: $this->withBool($this->public, $public), | ||
immutable: $this->withBool($this->immutable, $immutable), | ||
staleWhileRevalidating: $this->withInt($this->staleWhileRevalidating, $staleWhileRevalidating), | ||
staleIfError: $this->withInt($this->staleIfError, $staleIfError), | ||
); | ||
} |
Check warning
Code scanning / PHPMD
Code Size Rules: ExcessiveParameterList Warning
2acfe2f
to
92ea447
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #56 +/- ##
============================================
+ Coverage 32.52% 37.44% +4.91%
- Complexity 538 570 +32
============================================
Files 51 50 -1
Lines 1823 1888 +65
============================================
+ Hits 593 707 +114
+ Misses 1230 1181 -49 ☔ View full report in Codecov by Sentry. |
Closes #39
This adds some attributes for caching per component where the "highest score wins" type of algorithm. Basically private > public, max-age < no-cache < must-revalidate, etc.