Skip to content
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

HTTP Caching #36

Closed
1 of 3 tasks
johanjanssens opened this issue Aug 29, 2016 · 0 comments
Closed
1 of 3 tasks

HTTP Caching #36

johanjanssens opened this issue Aug 29, 2016 · 0 comments
Assignees
Labels
Milestone

Comments

@johanjanssens
Copy link
Member

johanjanssens commented Aug 29, 2016

Create a dispatcher http transport that transparently caches the response based on the request state and handles cache validation.

See: https://github.com/joomlatools/textman/issues/112
See: joomlatools/joomlatools-pages#21

Resources

Other

Notes

  1. Headers in the 304 update the stored response headers
  2. Clicking refresh: Cache-Control: max-age=0
  3. Disabling cache: Cache-Control: no-cache

Todo

  • HTTP specifies that caches should be invalidated when unsafe request methods are used and the response is successful – i.e., a 2xx or 3xx status code. Unsafe methods include POST, PUT and DELETE, as well as unknown status codes.

  • HTTP lets servers specify that the cache key depends on more than just the URL by using the Vary header, which lists the request headers whose values should be added to it. This secondary cache key enables things like caching compressed content, and generally in supporting content negotiation.

  • Add Support for s-maxage to allow to define a separate proxy cache time and browser cache time. See: https://support.cloudflare.com/hc/en-us/articles/202775670-How-Do-I-Tell-Cloudflare-What-to-Cache- (see Add support for s-maxage #266)

@johanjanssens johanjanssens added this to the 3.0.0 milestone Aug 29, 2016
@johanjanssens johanjanssens modified the milestones: Backlog, 3.0 Dec 22, 2016
@johanjanssens johanjanssens self-assigned this Jun 13, 2018
@johanjanssens johanjanssens modified the milestones: Backlog, Develop Aug 4, 2018
@johanjanssens johanjanssens changed the title Implemented support for If-Modified-Since requests HTTP Caching Aug 14, 2018
johanjanssens added a commit that referenced this issue Sep 4, 2018
- Add cacheable dispatcher behavior that supports etag based cache validation. The etag is calculated based on the contents of the response and the user id (default 0)
- Add KDispatcherRequest::getEtags() to retrieve the etag from the request
- Do not clean the response stream buffer for 304 respones, instead do not send the response to the output.
- Do net send an etag when streaming
- Add KHttpRequest::isCacheable() by default get and head request that don't have cache-control set to 'no-cache' are cacheable.
- Remove KHttpRequest::isFlash() method.
- Remove KHttpResponse::getExpires() and setExpires(). Expires headers are considered deprecated.
- Optimise KResponse logic for proper cache handling
ercanozkaya added a commit to timble/kodekit that referenced this issue Nov 9, 2018
ercanozkaya added a commit that referenced this issue Nov 12, 2018
Since each cookie gets its own header, this would only send the last cookie
@johanjanssens johanjanssens modified the milestones: Develop, Backlog Nov 20, 2018
johanjanssens added a commit that referenced this issue Dec 31, 2018
- Move etag validation to http transport
- If etag validates automatically set the response status to not modified
- Calculate the etag based on the request and not the response content
johanjanssens added a commit that referenced this issue Jan 7, 2019
johanjanssens added a commit that referenced this issue Jan 7, 2019
johanjanssens added a commit that referenced this issue Jan 7, 2019
johanjanssens added a commit that referenced this issue Jan 7, 2019
- Do not cast header values to array when being set
- Properly handle rendering of multiple header values
johanjanssens added a commit that referenced this issue Jan 7, 2019
@johanjanssens johanjanssens modified the milestones: Backlog, 3.4 Nov 17, 2020
@johanjanssens johanjanssens modified the milestones: 3.5, v3.5.0 Apr 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants