7 Replies Latest reply on Jun 25, 2007 10:13 AM by UpstateWeb

    Determine Page Size

    UpstateWeb Level 1
      I know the LogFiles store the sc_bytes & cs_bytes for each page viewed, but is there a way do do this in real time on the bottom of each page?

      Thank you in advance!

      David G. Moore, Jr.
      UpstateWeb LLC
        • 1. Re: Determine Page Size
          Charlie Griefer Level 1
          if you're on CFMX...

          play around with the best way to utilize this...

          <cfscript>
          jfile = createObject('java','java.io.File').init(getCurrentTemplatePath());
          </cfscript>

          put this at the bottom of the page:
          <cfoutput>#round(jFile.length()/1024)#k</cfoutput>
          • 2. Re: Determine Page Size
            Level 7
            if you're on CFMX...

            play around with the best way to utilize this...

            <cfscript>
            jfile = createObject('java','java.io.File').init(getCurrentTemplatePath());
            </cfscript>

            put this at the bottom of the page:
            <cfoutput>#round(jFile.length()/1024)#k</cfoutput>

            • 3. Re: Determine Page Size
              UpstateWeb Level 1
              Thanks for the suggestion. It does pass a value, but I am not sure it is exactly what I am looking for. I don't think it takes into consideration all the attached files and images on the page. When I run a test at http://www.tasman-webdesign.com/page_size.html I get a value of 34K, where as the value I get from your code is 8k. You can go to my website and look on the very bottom of the page for the value I am getting.

              I think you answered my question, I guess I just need to expand on it. And yes, I am using CF6.1. Any more ideas? I am trying to replicate the sc_bytes and cs_bytes that are passed to the LogFiles.

              Thanks again!
              • 4. Re: Determine Page Size
                tclaremont Level 2
                I think the 8k might be the total for the code itself. 34k might include all images, etc.

                Does that jive with what you are experiencing?
                • 5. Re: Determine Page Size
                  UpstateWeb Level 1
                  Yes. I think that is what is going on. I wonder is there is a way to get everything? Again, I am trying to replicate the sc_bytes and cs_bytes that are passed to the LogFiles.
                  • 6. Re: Determine Page Size
                    Charlie Griefer Level 1
                    yeah, sorry. my code above just gives the page size of the current template.

                    not sure offhand of how to programatically figure images and the like. will mess around and see if i can come up with something.
                    • 7. Re: Determine Page Size
                      UpstateWeb Level 1
                      It seems to be something that isn't "off the shelf". I would have thought it would have been fairly common place. I have been tinkering for a couple of months and looking on forums. Nothing yet. I will keep looking. If you come up with something, that would be great. If I come across something, I will share here.

                      Otherwise, maybe someone else on the forums might have an idea. Anyone else out there?

                      I have been able to replicate every other value from the LogFiles except sc_bytes, cs_bytes.