Repository navigation
Conversation
Member
Author
|
Replaced by #77, a docs only approach. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Makes the bar work behind Varnish, on a live shop and on a developer's own Varnish setup alike, without hurting the visitors' cache.
HttpPluginnow addssiteation_debugbarto Magento's HTTP context on storefront requests that get the bar. That value ends up in theX-Magento-Varycookie, which both the built in full page cache and Magento's Varnish VCL hash on, so a debugged page gets its own cache entry.Before this:
no-storeanswer made that entry hit-for-pass for two minutes for everyone.Scope: frontend only, the admin and APIs have no full page cache to vary. A failure to set the value is logged and the request continues.
Testing Varnish locally: a hit never reaches PHP, so it can never carry a bar, and keyless developer mode gives the bar to every local request (Varnish connects from a private address), so nothing is cached. The new user guide section "Testing Varnish locally" makes the key the switch: the browser holding it gets the bar on its own uncached entry, a private window or
curlwithout it is a visitor that Varnish caches as usual. The vary change is what keeps the two apart.Notes for review:
?siteation_debugbar_key=redirect, or any pass through page, sets it.HttpPlugintakesHttpContextas a new last constructor argument. Runsetup:di:compileafter upgrading.X-Magento-Tagsdocblock inBarInjectorontorefuseSharing().Docs: user guide (new "Testing Varnish locally", troubleshooting points to it), CHANGELOG. Three new
HttpPluginTestcases.