Movatterモバイル変換


[0]ホーム

URL:


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

[HttpFoundation] Adds support for the immutable directive in the cache-control header#22932

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

twoleds
Copy link
Contributor

@twoledstwoleds commentedMay 28, 2017
edited
Loading

QA
Branch?3.4
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#21425
LicenseMIT
Doc PR

Added support for the immutable directive in the cache-control header, tries toresolve#21425.

@twoledstwoleds changed the titleAdded support for the immutable directive in the cache-control header[HttpFoundation] Adds support for the immutable directive in the cache-control headerMay 28, 2017
@twoledstwoledsforce-pushed thetwoleds/cache-control-immutable branch fromcba133a toeb37144CompareMay 28, 2017 19:39
@xabbuhxabbuh added this to the3.4 milestoneMay 29, 2017
@twoledstwoledsforce-pushed thetwoleds/cache-control-immutable branch fromeb37144 to4b03f1bCompareMay 30, 2017 18:10
@twoledstwoleds changed the base branch frommaster to3.4May 30, 2017 18:25
@twoledstwoleds changed the base branch from3.4 tomasterMay 30, 2017 18:25
@greg0ire
Copy link
Contributor

  1. Fetch all new commits:git fetch --all. ⬇️
  2. Rebase on what you fetched interactively: ✂️
    1. git rebase -i origin/3.4, assumingorigin is a git remote that points to this repository, and not your fork. If you're not sure what your remotes are, rungit remote -vvv, there should be your fork and the holy/reference/base/origin repository.
    2. A window will show up with many lines, remove every line but the last one, which should correspond to your commit.
    3. If you run into a conflict: 💥
      1. fix it withgit mergetool. 😷
      2. continue on your merry way withgit rebase --continue. ⏩
  3. Force push to overwrite all this :git push --force. ⬆️

@twoledstwoledsforce-pushed thetwoleds/cache-control-immutable branch from4b03f1b tocbf1dccCompareMay 30, 2017 19:06
@twoledstwoleds changed the base branch frommaster to3.4May 30, 2017 19:06
@twoledstwoledsforce-pushed thetwoleds/cache-control-immutable branch 5 times, most recently fromabcdae4 tof9bbae7CompareJune 6, 2017 20:07
@twoledstwoledsforce-pushed thetwoleds/cache-control-immutable branch 2 times, most recently fromcf6bc1f tofba0d33CompareJune 9, 2017 19:45
*
* @return $this
*/
public function setImmutable($immutable = true)
Copy link
Member

Choose a reason for hiding this comment

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

a default value doesn't make much sense here IMO

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

OK I understand. My idea was calling thesetImmutable method without argument like setPublic/setPrivate method.

return (newResponse('SOME RESPONSE DATA'))  ->setPublic()  ->setImmutable();
return (newResponse('SOME RESPONSE DATA'))  ->setPublic()  ->setImmutable(true);

I like the first example of code (callingsetImmutable without boolean value). Maybe it will be better to implement opposite methodsetMutable (which remove the flag immutable from theCache-Control header) and to remove the argument fromsetImmutable method completely. What is your opinion about it?

apfelbox reacted with thumbs up emoji
@@ -621,6 +621,34 @@ public function setPublic()
}

/**
* Marks the response as "immutable".
*
* @param bool $immutable Enables or disabled the immutable directive.
Copy link
Contributor

Choose a reason for hiding this comment

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

"disables"

@@ -992,6 +1020,10 @@ public function setCache(array $options)
}
}

if (isset($options['immutable'])) {
$this->setImmutable($options['immutable'] ? true : false);
Copy link
Contributor

Choose a reason for hiding this comment

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

How about a cast to book?

Copy link
Contributor

Choose a reason for hiding this comment

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

*bool lol

@twoledstwoledsforce-pushed thetwoleds/cache-control-immutable branch fromfba0d33 to2143effCompareJune 13, 2017 17:48
@twoledstwoledsforce-pushed thetwoleds/cache-control-immutable branch from60ca02e to7f603b7CompareJune 13, 2017 18:49
*/
public function isImmutable()
{
return $this->headers->getCacheControlDirective('immutable') ? true : false;
Copy link
Member

Choose a reason for hiding this comment

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

justreturn $this->headers->hasCacheControlDirective('immutable');

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Fixed, thanks for hint

@twoledstwoledsforce-pushed thetwoleds/cache-control-immutable branch 2 times, most recently from695fd9a to4cf01a1CompareJune 14, 2017 21:10
@twoledstwoledsforce-pushed thetwoleds/cache-control-immutable branch from4cf01a1 to33573c6CompareJune 17, 2017 07:49
@fabpot
Copy link
Member

Thank you@twoleds.

twoleds reacted with thumbs up emoji

@fabpotfabpot merged commit33573c6 intosymfony:3.4Jun 21, 2017
fabpot added a commit that referenced this pull requestJun 21, 2017
…ive in the cache-control header (twoleds)This PR was merged into the 3.4 branch.Discussion----------[HttpFoundation] Adds support for the immutable directive in the cache-control header| Q             | A| ------------- | ---| Branch?       | 3.4| Bug fix?      | no| New feature?  | yes| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#21425| License       | MIT| Doc PR        |Added support for the immutable directive in the cache-control header, tries toresolve#21425.Commits-------33573c6 Added support for the immutable directive in the cache-control header
This was referencedOct 18, 2017
@twoledstwoleds deleted the twoleds/cache-control-immutable branchMay 4, 2022 12:05
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@greg0iregreg0iregreg0ire approved these changes

@javiereguiluzjaviereguiluzjaviereguiluz approved these changes

@stofstofstof approved these changes

@xabbuhxabbuhxabbuh approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
3.4
Development

Successfully merging this pull request may close these issues.

6 participants
@twoleds@greg0ire@fabpot@javiereguiluz@stof@xabbuh

[8]ページ先頭

©2009-2025 Movatter.jp