2

I have a JSF page with 9 InputText boxes, and 2 InputSecret boxes. Each of these boxes has a label connected to a properties file, a validator(with a message), and contains an EL expression connected to a Named session scoped bean. I'm using Glassfish 3.1.2.1 as the application server. If I have the project_stage set to Development, I see a noticeable flash when this page is loaded or refreshed. It happens very quickly, but it appears as if the background(body) is being cleared to white before the page is loaded. If I set the project stage to Production, I do not see the flash. What is Project_Stage development doing that causes this behavior?

Marshall
  • 31
  • 4

1 Answers1

3

This is browser specific behaviour when it takes some time between the first byte and the last byte received from the HTTP response. Some browsers blanks out when the first byte is received and presents the new page in its entirety when the last byte is received. The human eye has a frame rate of about 25fps (as television is using). Anything which goes faster than that isn't noticeable to humans. But anything which goes slower than that causes the blankout to be visible.

The development stage causes some parts to be not cached so that the latest changes made in source files are immediately visible, such as Facelets source files. They are all re-compiled and re-parsed on a per-request basis. All of this causes the page load time to take a little longer and therefore the browser blankout to be shortly visible when it appears longer than about 1/25 second.

You may want to consider to increase the Facelets buffer size in web.xml to about the size of your largest HTML output, so that the response is sent in one go instead of in parts which may require some more pre-processing time.

E.g. 64KB:

<context-param>
    <param-name>javax.faces.FACELETS_BUFFER_SIZE</param-name>
    <param-value>65535</param-value> <!-- 64KB -->
</context-param>
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • 1
    Thanks for your answer. I increased the cache size to 64KB as suggested, and that eliminated the page load flash I was seeing while in project_stage development. – Marshall Mar 21 '13 at 13:57