• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Determine Page Size

Explorer ,
Jun 21, 2007 Jun 21, 2007

Copy link to clipboard

Copied

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
TOPICS
Advanced techniques

Views

556

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 21, 2007 Jun 21, 2007

Copy link to clipboard

Copied

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>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 22, 2007 Jun 22, 2007

Copy link to clipboard

Copied

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!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 21, 2007 Jun 21, 2007

Copy link to clipboard

Copied

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>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jun 25, 2007 Jun 25, 2007

Copy link to clipboard

Copied

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 25, 2007 Jun 25, 2007

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 25, 2007 Jun 25, 2007

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 25, 2007 Jun 25, 2007

Copy link to clipboard

Copied

LATEST
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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation