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

[HttpKernel] Add a "short" trace header format, make header configurable#30964

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

@mpdude
Copy link
Contributor

@mpdudempdude commentedApr 7, 2019
edited
Loading

QA
Branch?master
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets
LicenseMIT
Doc PRsymfony/symfony-docs#11340

This pull requests adds the first usage ofarray_key_first to the Symfony code base. Additionally, it makes it possible to configure theHttpCache to also add a "trace" header in production.

TheHttpCache is a convenient, low-barrier yet performant way of accelerating the application. By having the "trace" information returned as a header in production as well, you can write it to server log files. For example, with Apache you can use%{X-Symfony-Cache}o in theLogFormat directive to log response headers.

With the information in the log files, you can easily process it from logfile processing/system metrics tools to find out about cache performance, efficiency and the URLs that might need extra cache tweaking.

Bildschirmfoto 2019-04-07 um 11 43 23

The "short" format will only output information for the main request to avoid leaking internal URLs for ESI subrequests. I also chose a concise format likestale/valid/store because that's much easier to parse out of logfiles (no whitespace, no need for quotes etc.).

If you're not comfortable with havingSymfony in the header name that way, the header name can be changed through a configuration setting as well.

#FOSSHackathon

OskarStark and GwendolenLynch reacted with hooray emojiOskarStark, GwendolenLynch, and Toflar reacted with heart emoji
@mpdude
Copy link
ContributorAuthor

Fabbot complains about the (outdated?) license header only.

@fabpot
Copy link
Member

@mpdude You can ignore the header issue.

Copy link
Member

@stofstof left a comment

Choose a reason for hiding this comment

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

Please add tests covering the new behavior.

@mpdude
Copy link
ContributorAuthor

Tests added.

@nicolas-grekas
Copy link
Member

Thank you@mpdude.

OskarStark reacted with heart emoji

@nicolas-grekasnicolas-grekas merged commit9a2fcc9 intosymfony:masterApr 7, 2019
nicolas-grekas added a commit that referenced this pull requestApr 7, 2019
…eader configurable (mpdude)This PR was squashed before being merged into the 4.3-dev branch (closes#30964).Discussion----------[HttpKernel] Add a "short" trace header format, make header configurable| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | yes| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets || License       | MIT| Doc PR        |symfony/symfony-docs#11340This pull requests adds the first usage of `array_key_first` to the Symfony code base. Additionally, it makes it possible to configure the `HttpCache` to also add a "trace" header in production.The `HttpCache` is a convenient, low-barrier yet performant way of accelerating the application. By having the "trace" information returned as a header in production as well, you can write it to server log files. For example, with Apache you can use `%{X-Symfony-Cache}o` in the `LogFormat` directive to log response headers.With the information in the log files, you can easily process it from logfile processing/system metrics tools to find out about cache performance, efficiency and the URLs that might need extra cache tweaking.<img width="1040" alt="Bildschirmfoto 2019-04-07 um 11 43 23" src="https://user-images.githubusercontent.com/1202333/55681763-6e90e980-592a-11e9-900f-e096350531c2.png">The "short" format will only output information for the main request to avoid leaking internal URLs for ESI subrequests. I also chose a concise format like `stale/valid/store` because that's much easier to parse out of logfiles (no whitespace, no need for quotes etc.).If you're not comfortable with having `Symfony` in the header name that way, the header name can be changed through a configuration setting as well.#FOSSHackathonCommits-------9a2fcc9 [HttpKernel] Add a \"short\" trace header format, make header configurable
@mpdudempdude deleted the http-cache-status-header branchApril 7, 2019 12:26
wouterj added a commit to symfony/symfony-docs that referenced this pull requestApr 7, 2019
… config options in `HttpCache` (mpdude)This PR was squashed before being merged into the master branch (closes#11340).Discussion----------[HttpKernel] Document `trace_level` and `trace_header` config options in `HttpCache`Here's a small addition forsymfony/symfony#30964.#FOSSHackathonCommits-------75febdc [HttpKernel] Document `trace_level` and `trace_header` config options in `HttpCache`
@nicolas-grekasnicolas-grekas modified the milestones:next,4.3Apr 30, 2019
@fabpotfabpot mentioned this pull requestMay 9, 2019
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@stofstofstof left review comments

@fabpotfabpotfabpot approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

4.3

Development

Successfully merging this pull request may close these issues.

6 participants

@mpdude@fabpot@nicolas-grekas@stof@michaelcullum@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp