How can I check the reason why varnish did not cache a response?Why cache static files with Varnish, why not passCan varnish cache files without specific extension or residing in specific directoryForce request to miss cache but still store the responseVarnish cached 'MISS status' object?Why is Varnish not caching my index page properly?Varnish cache objects expiring while in stale-while-revalidate grace periodVarnish ESI Streaming Response - Is it possible NOT to stream the responseIs there a better way to analyze Varnish hit rateVarnish: Is it possible to not cache only one specific part of the page?Varnish cache randomly changing response content-length
Is real public IP Address hidden when using a system wide proxy in Windows 10?
How to know if a folder is a symbolic link?
Plot twist where the antagonist wins
Crossing US border with music files I'm legally allowed to possess
I think I may have violated academic integrity last year - what should I do?
Binary Search in C++17
Should I disclose a colleague's illness (that I should not know) when others badmouth him
Is the Starlink array really visible from Earth?
In general, would I need to season a meat when making a sauce?
Have 1.5% of all nuclear reactors ever built melted down?
Count rotary dial pulses in a phone number (including letters)
How should I introduce map drawing to my players?
pic versus macro in TikZ
How to Pin Point Large File eating space in Fedora 18
Compactness of finite sets
What are these arcade games in Ghostbusters 1984?
Simple fuzz pedal using breadboard
A steel cutting sword?
What is a Centaur Thief's climbing speed?
the meaning of 'carry' in a novel
Why are C64 games inconsistent with which joystick port they use?
How to remove the trailing ` in StringForm["Mean `1`", 2.2]?
What are the real benefits of using Salesforce DX?
Are these reasonable traits for someone with autism?
How can I check the reason why varnish did not cache a response?
Why cache static files with Varnish, why not passCan varnish cache files without specific extension or residing in specific directoryForce request to miss cache but still store the responseVarnish cached 'MISS status' object?Why is Varnish not caching my index page properly?Varnish cache objects expiring while in stale-while-revalidate grace periodVarnish ESI Streaming Response - Is it possible NOT to stream the responseIs there a better way to analyze Varnish hit rateVarnish: Is it possible to not cache only one specific part of the page?Varnish cache randomly changing response content-length
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I am seeing that the hit-rate in varnishstat is constantly being 0. Is there any way I can check why a specific request is not being served from cache or the reason why a specific response was not cached.
varnish
add a comment |
I am seeing that the hit-rate in varnishstat is constantly being 0. Is there any way I can check why a specific request is not being served from cache or the reason why a specific response was not cached.
varnish
add a comment |
I am seeing that the hit-rate in varnishstat is constantly being 0. Is there any way I can check why a specific request is not being served from cache or the reason why a specific response was not cached.
varnish
I am seeing that the hit-rate in varnishstat is constantly being 0. Is there any way I can check why a specific request is not being served from cache or the reason why a specific response was not cached.
varnish
varnish
asked Mar 11 '14 at 7:18
akshatakshat
1591110
1591110
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Adapt and add this to your vcl, in sub vcl_fetch. Mostly, not hitting is a result of a cookie in the request when it leaves your vcl_recv config.
# Section sets http return headers, for caching diagnosis
if (!beresp.ttl > 0s)
set beresp.http.X-Cacheable = "NO:Not-Cacheable";
if (req.http.Cookie && req.http.Cookie ~ "wordpress_") set beresp.http.X-Cacheable = "NO:Authed-user";
elseif (req.http.Cookie && req.http.Cookie ~ "PHPSESSID") set beresp.http.X-Cacheable = "NO:PHP-SESS";
elseif (req.http.Cookie && req.http.Cookie ~ "vendor_re") set beresp.http.X-Cacheable = "NO:vendor-region";
elseif (req.http.Cookie && req.http.Cookie ~ "themetype2") set beresp.http.X-Cacheable = "NO:themetype2";
elseif (req.http.X-Requested-With == "XMLHttpRequest") set beresp.http.X-Cacheable = "NO:Ajax";
return(hit_for_pass);
You will probably need to adapt that. But, you can then see those X-Cacheable headers in the site.
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "2"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f581213%2fhow-can-i-check-the-reason-why-varnish-did-not-cache-a-response%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Adapt and add this to your vcl, in sub vcl_fetch. Mostly, not hitting is a result of a cookie in the request when it leaves your vcl_recv config.
# Section sets http return headers, for caching diagnosis
if (!beresp.ttl > 0s)
set beresp.http.X-Cacheable = "NO:Not-Cacheable";
if (req.http.Cookie && req.http.Cookie ~ "wordpress_") set beresp.http.X-Cacheable = "NO:Authed-user";
elseif (req.http.Cookie && req.http.Cookie ~ "PHPSESSID") set beresp.http.X-Cacheable = "NO:PHP-SESS";
elseif (req.http.Cookie && req.http.Cookie ~ "vendor_re") set beresp.http.X-Cacheable = "NO:vendor-region";
elseif (req.http.Cookie && req.http.Cookie ~ "themetype2") set beresp.http.X-Cacheable = "NO:themetype2";
elseif (req.http.X-Requested-With == "XMLHttpRequest") set beresp.http.X-Cacheable = "NO:Ajax";
return(hit_for_pass);
You will probably need to adapt that. But, you can then see those X-Cacheable headers in the site.
add a comment |
Adapt and add this to your vcl, in sub vcl_fetch. Mostly, not hitting is a result of a cookie in the request when it leaves your vcl_recv config.
# Section sets http return headers, for caching diagnosis
if (!beresp.ttl > 0s)
set beresp.http.X-Cacheable = "NO:Not-Cacheable";
if (req.http.Cookie && req.http.Cookie ~ "wordpress_") set beresp.http.X-Cacheable = "NO:Authed-user";
elseif (req.http.Cookie && req.http.Cookie ~ "PHPSESSID") set beresp.http.X-Cacheable = "NO:PHP-SESS";
elseif (req.http.Cookie && req.http.Cookie ~ "vendor_re") set beresp.http.X-Cacheable = "NO:vendor-region";
elseif (req.http.Cookie && req.http.Cookie ~ "themetype2") set beresp.http.X-Cacheable = "NO:themetype2";
elseif (req.http.X-Requested-With == "XMLHttpRequest") set beresp.http.X-Cacheable = "NO:Ajax";
return(hit_for_pass);
You will probably need to adapt that. But, you can then see those X-Cacheable headers in the site.
add a comment |
Adapt and add this to your vcl, in sub vcl_fetch. Mostly, not hitting is a result of a cookie in the request when it leaves your vcl_recv config.
# Section sets http return headers, for caching diagnosis
if (!beresp.ttl > 0s)
set beresp.http.X-Cacheable = "NO:Not-Cacheable";
if (req.http.Cookie && req.http.Cookie ~ "wordpress_") set beresp.http.X-Cacheable = "NO:Authed-user";
elseif (req.http.Cookie && req.http.Cookie ~ "PHPSESSID") set beresp.http.X-Cacheable = "NO:PHP-SESS";
elseif (req.http.Cookie && req.http.Cookie ~ "vendor_re") set beresp.http.X-Cacheable = "NO:vendor-region";
elseif (req.http.Cookie && req.http.Cookie ~ "themetype2") set beresp.http.X-Cacheable = "NO:themetype2";
elseif (req.http.X-Requested-With == "XMLHttpRequest") set beresp.http.X-Cacheable = "NO:Ajax";
return(hit_for_pass);
You will probably need to adapt that. But, you can then see those X-Cacheable headers in the site.
Adapt and add this to your vcl, in sub vcl_fetch. Mostly, not hitting is a result of a cookie in the request when it leaves your vcl_recv config.
# Section sets http return headers, for caching diagnosis
if (!beresp.ttl > 0s)
set beresp.http.X-Cacheable = "NO:Not-Cacheable";
if (req.http.Cookie && req.http.Cookie ~ "wordpress_") set beresp.http.X-Cacheable = "NO:Authed-user";
elseif (req.http.Cookie && req.http.Cookie ~ "PHPSESSID") set beresp.http.X-Cacheable = "NO:PHP-SESS";
elseif (req.http.Cookie && req.http.Cookie ~ "vendor_re") set beresp.http.X-Cacheable = "NO:vendor-region";
elseif (req.http.Cookie && req.http.Cookie ~ "themetype2") set beresp.http.X-Cacheable = "NO:themetype2";
elseif (req.http.X-Requested-With == "XMLHttpRequest") set beresp.http.X-Cacheable = "NO:Ajax";
return(hit_for_pass);
You will probably need to adapt that. But, you can then see those X-Cacheable headers in the site.
answered Mar 14 '14 at 18:31
KirrusKirrus
433211
433211
add a comment |
add a comment |
Thanks for contributing an answer to Server Fault!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f581213%2fhow-can-i-check-the-reason-why-varnish-did-not-cache-a-response%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown