3

I use OmniFaces 2.2 togehter with PrimeFaces 5.3 and BootsFaces 0.8.1. Since it is recomended to use CombinedResourceHandler with BootsFaces I tried to use first as per BootsFaces instructions: http://showcase.bootsfaces.net/integration/OmniFaces.jsf

<context-param>
    <param-name>org.omnifaces.COMBINED_RESOURCE_ACTIVATE_RESOURCE_CACHING</param-name>
    <param-value>true</param-value>
</context-param>
<context-param>
    <param-name>org.omnifaces.CACHE_SETTING_APPLICATION_MAX_CAPACITY</param-name>
    <param-value>30</param-value>
</context-param>
<context-param>
    <param-name>org.omnifaces.CACHE_SETTING_APPLICATION_TTL</param-name>
    <param-value>86400</param-value>
</context-param>

In my application I use my own JS libary and own CSS stuff inside the <h:head> of my layout/template XHTML.

<h:outputStylesheet library="css" name="custom.css"/>
<h:outputScript library="scripts" name="js/custom_scripts.js" target="head"/>

The CombinedResourceHandler is enabled inside the faces-config. The application is in Production mode and on every reload on every page the pageload takes much time to download the combined css and js files as you can see in the attached image:

Pageload

So the whole pageload is double to three times higher than without the CombinedResourceHandler. The only thing I can imagine is that I am using it completely wrong. But where is my failure?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
ScreamingTree
  • 302
  • 1
  • 13
  • http://showcase.omnifaces.org/resourcehandlers/CombinedResourceHandler documentation says to use `org.omnifaces.COMBINED_RESOURCE_HANDLER_CACHE_TTL`. Replace all those params with it. Where exactly did you get them from? – BalusC Mar 07 '16 at 12:41
  • @BalusC i got it from here http://showcase.bootsfaces.net/integration/OmniFaces.jsf – ScreamingTree Mar 07 '16 at 12:43
  • 1
    Oh, that's only applicable when you manually modify OmniFaces as per their instructions. This is not necessary anymore since it has been added to OmniFaces 2.1 (and improved/simplified so that it requires only 1 param). – BalusC Mar 07 '16 at 12:44
  • Ah okay. Jep i replaced it. Now it works much better :) Thank you! – ScreamingTree Mar 07 '16 at 12:47

1 Answers1

4

Those context parameters are not correct. Those are only applicable when you modify OmniFaces 2.0 as per BootsFaces own instructions.

Since OmniFaces 2.1, the solution was integrated as per issue 100 and code and configuration have been simplified so that only the below context parameter is necessary in order to enable combined resource handler cache:

<context-param>
    <param-name>org.omnifaces.COMBINED_RESOURCE_HANDLER_CACHE_TTL</param-name>
    <param-value>86400</param-value>
</context-param>

See also the documentation on the CombinedResourceHandler showcase.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • 1
    Thanks for the hint. We're going to update our BootsFaces showcase as soon as possible. As you, @BalusC, pointed out, our instructions work if you follow all of them - but there are obviously confusing. – Stephan Rauh Mar 07 '16 at 20:37