Foros de discusión

static barebone.jsp (performance)

Michael Rohleder, modificado hace 10 años.

static barebone.jsp (performance)

New Member Mensajes: 19 Fecha de incorporación: 31/07/13 Mensajes recientes
I try to optimize a 6.2 installation for performance.

One thing I tried was putting the barebone.jsp in the static apache web space.
this works fine (and gains alot) until someone logs in, then the dockbar is gone.
(I didnt put everything.jsp to apache)

I always thought that barebone.jsp is for anon/guest and everything.jsp is the "rest", but this doesnt seem true...

Can someone give me hint where the barebone.jsp is generated, so i can debug this?


regards
micha
thumbnail
David H Nebinger, modificado hace 10 años.

RE: static barebone.jsp (performance)

Liferay Legend Mensajes: 14919 Fecha de incorporación: 2/09/06 Mensajes recientes
So you're plan is to put a dynamic JSP page into a static web server so it will not be interpreted anymore and then wonder why it's not interpreted?
Michael Rohleder, modificado hace 10 años.

RE: static barebone.jsp (performance)

New Member Mensajes: 19 Fecha de incorporación: 31/07/13 Mensajes recientes
Yeah, saw this idea in the book "Liferay Portal Performance Best Practices".

anyway... where/how is it generated?

(I think I can workaround my problem with a setifenv for a non anon header in apache, but i want to understand and look at the sources ^^ )
thumbnail
David H Nebinger, modificado hace 10 años.

RE: static barebone.jsp (performance)

Liferay Legend Mensajes: 14919 Fecha de incorporación: 2/09/06 Mensajes recientes
you can move the static files to httpd (i do that w/ css, images, and the like). But JSP is supposed to be dynamic; by treating it as static you're eliminating the dynamic capabilities...
Michael Rohleder, modificado hace 10 años.

RE: static barebone.jsp (performance)

New Member Mensajes: 19 Fecha de incorporación: 31/07/13 Mensajes recientes
sure...

the barebone.jsp conains all the javascript files configured via javascript.barebone.files, not sure if it is a real jsp, thats why I ask:

Where is this generated? (is there a filter or something?)
or
if it is a real jsp (as David suggests), where is the source of it?
thumbnail
David H Nebinger, modificado hace 10 años.

RE: static barebone.jsp (performance)

Liferay Legend Mensajes: 14919 Fecha de incorporación: 2/09/06 Mensajes recientes
Well, the files are in html/js although they are completely blank. The portal will inject stuff into the jsp from the values in portal and portal-ext.properties (that's part of what makes them dynamic).
Michael Rohleder, modificado hace 10 años.

RE: static barebone.jsp (performance)

New Member Mensajes: 19 Fecha de incorporación: 31/07/13 Mensajes recientes
yeah, but do you know _where_ (which code) the portal is doing this?
thumbnail
Krzysztof Gołębiowski, modificado hace 10 años.

RE: static barebone.jsp (performance)

Liferay Master Mensajes: 549 Fecha de incorporación: 25/06/11 Mensajes recientes
The file is included here: https://github.com/liferay/liferay-portal/blob/master/portal-web/docroot/html/common/themes/top_js.jspf#L315-L317. It seems that it's generated by PortalImpl.getStaticResourceURL but I haven't checked how it exactly works.

Regards,
KG
thumbnail
David H Nebinger, modificado hace 10 años.

RE: static barebone.jsp (performance)

Liferay Legend Mensajes: 14919 Fecha de incorporación: 2/09/06 Mensajes recientes
It's also intercepted by a few of the servlet filters, so there's definitely things supposed to happen at the portal level when this file is requested.
thumbnail
Vilmos Papp, modificado hace 10 años.

RE: static barebone.jsp (performance)

Liferay Master Mensajes: 529 Fecha de incorporación: 21/10/10 Mensajes recientes
Hi David,

If you check www.liferay.com's source without logging in, you will find that barebone.jsp comes from cdn.
Michael Rohleder, modificado hace 10 años.

RE: static barebone.jsp (performance)

New Member Mensajes: 19 Fecha de incorporación: 31/07/13 Mensajes recientes
Hi Vilmos,

thank you very much for checking this.
This is pretty much what Im trying to do...

Also, if you log in, the everything.jsp comes from the cdn as well...
Michael Rohleder, modificado hace 10 años.

RE: static barebone.jsp (performance)

New Member Mensajes: 19 Fecha de incorporación: 31/07/13 Mensajes recientes
Hi Krzysztof,

thank you very much for this helpful info!

In top_js.jspf the "<script src=.../barebone.jsp...>" is generated.
One sugestion here:
It might add an "async" param to the script tag?!
(I will test this...)

But I still dont find the part in the sources, where the request to barebone/everything is handled...
thumbnail
Krzysztof Gołębiowski, modificado hace 10 años.

RE: static barebone.jsp (performance)

Liferay Master Mensajes: 549 Fecha de incorporación: 25/06/11 Mensajes recientes
Michael,
Now after deeper examination of the code, I think that both barebone.js and everything.js are qualified for being cached by default. If you have properly configured CDN in Liferay, both URLs should be prefixed with CDN host and both have timestamp value at the end. Since 6.2 there is even new property in portal.properties called cdn.dynamic.resources.enabled which is by default set to true:

    #
    # Set this to true to enable serving dynamically generated CSS, JavaScript,
    # and images via a CDN. Setting this to false allows the usage of CDNs that
    # do not support lazy loading of resources (e.g. Amazon CloudFront).
    #
    cdn.dynamic.resources.enabled=true

Regards,
KG
Riccardo Martini, modificado hace 9 años.

RE: static barebone.jsp (performance)

New Member Mensajes: 16 Fecha de incorporación: 19/06/09 Mensajes recientes
Hi,
I use "cdn.dynamic.resources.enabled" to false and the file "barebone.jsp" is not cached by cdn. In top_js the file is included with the prefix "themeDisplay.getCDNDynamicResourcesHost()" and not "themeDisplay.getCDNHost()". Can I substitute "themeDisplay.getCDNDynamicResourcesHost()" with "themeDisplay.getCDNHost()" ?
I use Amazon cloudfront.

Thanks
Riccardo
Traolly Xiong, modificado hace 9 años.

RE: static barebone.jsp (performance)

Regular Member Mensajes: 195 Fecha de incorporación: 30/12/11 Mensajes recientes
Question for you Michael.

In adding the "async" to the "barebone.jsp" script tag, I start getting a bunch off errors. Did you get any errors, and if so how did you resolve them while
still getting the script to be requested asynchronously?

ex) Errors within the "main.js....."
Uncaught ReferenceError: AUI is not defined
Uncaught TypeError: Cannot read property 'addInputfocus" of undefined
Uncaught TypeError: Cannot read property 'onLoad" of undefined
Thanks.

Traolly Xiong
thumbnail
David H Nebinger, modificado hace 9 años.

RE: static barebone.jsp (performance)

Liferay Legend Mensajes: 14919 Fecha de incorporación: 2/09/06 Mensajes recientes
It means that the javascript you're loading expects barebones to be in place before it is evaluated, but by making it async it isn't loaded yet and therefore the page cannot evaluate properly.