Skip to content

RFC8246 HTTP Immutable Responses#462

Merged
arturobernalg merged 1 commit intoapache:5.3.xfrom
arturobernalg:immutable
Jul 24, 2023
Merged

RFC8246 HTTP Immutable Responses#462
arturobernalg merged 1 commit intoapache:5.3.xfrom
arturobernalg:immutable

Conversation

@arturobernalg
Copy link
Member

@arturobernalg arturobernalg commented Jun 24, 2023

This commit adds the functionality to handle the 'immutable' directive in the Cache-Control header as per the RFC specifications.

Key changes include:

  • The 'immutable' directive is checked in the Cache-Control of an HTTP response, indicating that the origin server will not update the resource representation during the response's freshness lifetime.
  • If the 'immutable' directive is present and the response is still fresh, the response is considered cacheable without further validation.
  • Ignoring any arguments with the 'immutable' directive, as per RFC stipulations.
  • Treating multiple instances of the 'immutable' directive as equivalent to one.

@ok2c ok2c changed the title Implement Cache-Control Extension in Response Caching Policy. HTTPCLIENT-2277: Implement Cache-Control Extension in Response Caching Policy. Jul 4, 2023

// calculate freshness lifetime
final Duration freshnessLifetime = calculateFreshnessLifetime(cacheControl, response);

Copy link
Member

Choose a reason for hiding this comment

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

@arturobernalg I cannot find immutable cache control directive mentioned anywhere in the RFC 9111. Am I missing something?

@arturobernalg
Copy link
Member Author

arturobernalg commented Jul 19, 2023

@ok2c. You're absolutely right. This change pertains to the rfc8246.

@ok2c
Copy link
Member

ok2c commented Jul 20, 2023

@ok2c. You're absolutely right. This change pertains to the rfc8246.

@arturobernalg Could you please reflect this in the PR title and the commit message?

@arturobernalg arturobernalg changed the title HTTPCLIENT-2277: Implement Cache-Control Extension in Response Caching Policy. RFC8246 HTTP Immutable Responses Jul 20, 2023
@arturobernalg
Copy link
Member Author

@ok2c. You're absolutely right. This change pertains to the rfc8246.

@arturobernalg Could you please reflect this in the PR title and the commit message?

@ok2c
Done.
The commit message doesn't need many changes. In any case, I've made a reference to the RFC.

@ok2c
Copy link
Member

ok2c commented Jul 22, 2023

@arturobernalg Looks good to me, but can we drop no-transform out of the change-set? It is unrelated to the stated objective of the change-set and is presently not used anywhere in the caching logic.

This commit adds the functionality to handle the 'immutable' directive in the Cache-Control header as per the RFC8246 specifications.

Key changes include:
- The 'immutable' directive is checked in the Cache-Control of an HTTP response, indicating that the origin server will not update the resource representation during the response's freshness lifetime.
- If the 'immutable' directive is present and the response is still fresh, the response is considered cacheable without further validation.
- Ignoring any arguments with the 'immutable' directive, as per RFC stipulations.
- Treating multiple instances of the 'immutable' directive as equivalent to one.
@arturobernalg
Copy link
Member Author

@arturobernalg Looks good to me, but can we drop no-transform out of the change-set? It is unrelated to the stated objective of the change-set and is presently not used anywhere in the caching logic.

@ok2c Removed.

@arturobernalg arturobernalg merged commit f61fb51 into apache:5.3.x Jul 24, 2023
ok2c pushed a commit that referenced this pull request Aug 20, 2023
This commit adds the functionality to handle the 'immutable' directive in the Cache-Control header as per the RFC8246 specifications.

Key changes include:
- The 'immutable' directive is checked in the Cache-Control of an HTTP response, indicating that the origin server will not update the resource representation during the response's freshness lifetime.
- If the 'immutable' directive is present and the response is still fresh, the response is considered cacheable without further validation.
- Ignoring any arguments with the 'immutable' directive, as per RFC stipulations.
- Treating multiple instances of the 'immutable' directive as equivalent to one.
ok2c pushed a commit that referenced this pull request Dec 13, 2023
This commit adds the functionality to handle the 'immutable' directive in the Cache-Control header as per the RFC8246 specifications.

Key changes include:
- The 'immutable' directive is checked in the Cache-Control of an HTTP response, indicating that the origin server will not update the resource representation during the response's freshness lifetime.
- If the 'immutable' directive is present and the response is still fresh, the response is considered cacheable without further validation.
- Ignoring any arguments with the 'immutable' directive, as per RFC stipulations.
- Treating multiple instances of the 'immutable' directive as equivalent to one.
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

Comments