We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19315
    • 84 Posts
    Hi,

    I’m having a really weird issue with Firefox on my modx site. I get the viewable page content to be different to the content when I "view source". Specifically the content is the http_accept field sent to the server, i.e. I have a very short snippet which I include on the page.
    <?php
    return $_SERVER['HTTP_ACCEPT'];
    ?>

    When I load the page in Firefox I see
    text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

    However, if I then view the source in Firefox, I see
    text/css,*/*;q=0.1

    However, if I then refresh the source (ctrl-R), I see the same in the source as on the viewable page.

    What is going here? Note the snippet call is uncached, as is the page.

    Michal.
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      The last thing you requested was the css file. Refreshing the page the browser most likely does not reload the css file as long as it hasn’t changed.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 19315
        • 84 Posts
        Quote from: sottwell at Mar 31, 2008, 11:08 AM

        The last thing you requested was the css file. Refreshing the page the browser most likely does not reload the css file as long as it hasn’t changed.
        Sorry, I think I understand what you mean, that css files would not be reloaded upon refreshing of the page, but I don’t see how this could result in the effects I have described. Could I maybe ask what you think happens in terms of what http accept header is sent by the browser at which point and why?

        Michal.
          • 19315
          • 84 Posts
          I think I have found the reason for this. It is a combination of a problem with my template and a problem with Firefox.

          Looking at the Mozilla bugzilla I have found a few bugs about viewing source, e.g. https://bugzilla.mozilla.org/show_bug.cgi?id=392017 . Firefox apparently always reloads the page to view the source. In my template I actually have a CSS link in my head section that has an empty URL. On page load, this causes the browser to request the current page location, but looking for a CSS file. For some reason the view source reloads the page using the same request.

          Michal.