How to Find the size of the AEM page | Adobe Higher Education
Skip to main content
Level 5
March 29, 2017
Resuelto

How to Find the size of the AEM page

  • March 29, 2017
  • 8 respuestas
  • 4809 visualizaciones

Hi Team,

 I have a requirement to find the size of the AEM page. While writing the content if we can able give hint to authors saying that this page size : xxx.  

 Thanks

Este tema ha sido cerrado para respuestas.
Mejor respuesta de joerghoh

Hi,

during rendering it's normally not possible to determine the size of a page (unless you buffer all output in a request filter and calculate the size there, but that's not a really good idea ...). And it's even harder to determine the size of a page A when you have a page B containing a link to A and you want to add the information about the size of the linked page A.

So I would argue, that you should avoid to implement this, as it adds substantial cost and effort to your application.

Jörg

8 respuestas

MC_Stuff
Level 10
March 30, 2017

Hi,

if i understand correctly for current loaded page by author you need to provide the size.  it should be easy.  Get the Content-Length from header and covert to kilobytes ( by dividing with 1024).    Please note author & publish will have different size because in author has to inject other edit tags.

Thanks,

Level 5
March 30, 2017

Thanks, @MCstuff that's exactly I am looking for. How Can I get the content-length while loading the AEM page in authoring instance? 

I am able to see the content-length in firefox, not in google chrome. 

 

Thanks In Advance.

joerghoh
Adobe Employee
joerghohAdobe EmployeeRespuesta
Adobe Employee
March 30, 2017

Hi,

during rendering it's normally not possible to determine the size of a page (unless you buffer all output in a request filter and calculate the size there, but that's not a really good idea ...). And it's even harder to determine the size of a page A when you have a page B containing a link to A and you want to add the information about the size of the linked page A.

So I would argue, that you should avoid to implement this, as it adds substantial cost and effort to your application.

Jörg

Level 5
March 30, 2017

Humm, I will agree but we need to upload pages/articles to AWS cloud. AWS cloud allows only certain limit for uploading recently we found out that few pages/articles were too big in size to upload to AWS. We have around 70000 pages in the repository we need to find how many existing pages/articles crossed that size and for the new once we are just planning to alert the authors whenever it reaches that limit while authoring. Is there any way I can do get the size easily?

Thanks

MC_Stuff
Level 10
March 31, 2017

You are right @dragon2A chrome does not provide it[1].    Anyway to read the value need to use Header.  

@Jorg,    Why do you need to add the size of linked page?  The question in thread is size of the page & linked does not make sense since when they upload aws they will upload current page & not linked pages.    Unless I misunderstood & you agree , Possible option is have response wrapper & calculate the size.     

[1]  https://developer.chrome.com/extensions/webRequest

joerghoh
Adobe Employee
Adobe Employee
March 31, 2017

I just assumed that the requirement was to print the size of a page next to the link to this page :-

joerghoh
Adobe Employee
Adobe Employee
March 31, 2017

Hi,

dragon2A wrote...

Humm, I will agree but we need to upload pages/articles to AWS cloud. AWS cloud allows only certain limit for uploading recently we found out that few pages/articles were too big in size to upload to AWS. We have around 70000 pages in the repository we need to find how many existing pages/articles crossed that size and for the new once we are just planning to alert the authors whenever it reaches that limit while authoring. Is there any way I can do get the size easily?

Thanks

 


I wonder what kind of limit you are hitting regarding the size of the pages. Can you elaborate on it? I don't think that the problem is the size of a page (I rarely see pages larger than 100kb, but that shouldn't be a limit on any AWS service), but rather a problem of either using the wrong service or a programming error in your connection to AWS.

Jörg

Level 5
March 31, 2017

Hi Jorg,

You are right there is no limitation in AEM but our requirement little bit different.

  As I said we need to upload pages/documents to AWS cloud which has limitation it allows the only 1MB for single document and 5Mb for the batch documents.  Right now in the repository, we have identified couple pages crossed this size. We wanted to find all in one shot , then authors can split those pages in 2 and to avoid that to new pages we are planning to alert the authors.

Thanks