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;








0















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.










share|improve this question




























    0















    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.










    share|improve this question
























      0












      0








      0


      1






      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.










      share|improve this question














      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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 11 '14 at 7:18









      akshatakshat

      1591110




      1591110




















          1 Answer
          1






          active

          oldest

          votes


















          0














          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.






          share|improve this answer























            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
            );



            );













            draft saved

            draft discarded


















            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









            0














            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.






            share|improve this answer



























              0














              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.






              share|improve this answer

























                0












                0








                0







                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.






                share|improve this answer













                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.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 14 '14 at 18:31









                KirrusKirrus

                433211




                433211



























                    draft saved

                    draft discarded
















































                    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.




                    draft saved


                    draft discarded














                    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





















































                    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







                    Popular posts from this blog

                    How to write a 12-bar blues melodyI-IV-V blues progressionHow to play the bridges in a standard blues progressionHow does Gdim7 fit in C# minor?question on a certain chord progressionMusicology of Melody12 bar blues, spread rhythm: alternative to 6th chord to avoid finger stretchChord progressions/ Root key/ MelodiesHow to put chords (POP-EDM) under a given lead vocal melody (starting from a good knowledge in music theory)Are there “rules” for improvising with the minor pentatonic scale over 12-bar shuffle?Confusion about blues scale and chords

                    What if the end-user didn't have the required library?What is setup.py?What is a clean, pythonic way to have multiple constructors in Python?What does Ruby have that Python doesn't, and vice versa?What is the reason for having '//' in Python?How do I create a namespace package in Python?How to package shared objects that python modules depend on?setuptools vs. distutils: why is distutils still a thing?Navigation in Windows 10 vs code not going to virtualenv library when the same library is installed at user levelPython create package for local usePackaging a project that uses multiple python versionsWhy is permission denied on pip install except for when “--user” is included at end of command?

                    Why did Thanos need his ship to help him in the battle scene?Which actor plays Thanos in the Avengers mid-credits scene?Are there economic implications portrayed in comics where the buildings and cities are ruined almost daily?Old X-Men comic where team travels to alien world with a ring-like sun that needs recharging?Why does Ego need help sleeping?Is there an objective answer to who “the strongest Avenger” is?How did Banner get unstuck?Why did Thanos get hit?How did Thanos (or anyone) know the Infinity Stones would give him this power?Did Thanos leave Eitri alive for his after-sales service?In Avengers 1, why does Thanos need Loki?