There is an init-param facelets.REFRESH_PERIOD
for the Facelets servlet. However, it's senseless to set it to a specific value. When it's too small, say 10 seconds, the cache will be timeout too fast. When it's not so small, say 5 minutes, then I have to restart the web server frequently when a small change is made to the xhtml file. A value between 10 and 300 seconds maybe better, but never the best.
I'm using Apache myfaces-impl, I don't know much about Sun JSF RI. (Sun JSF RI doesn't work in our project) So, I don't know if this question is specific to Apache Myfaces?
Well, rather then specify the REFRESH_PERIOD
, can I just let myfaces-impl refresh those 开发者_如何学Gofiles which were changed?
(I guess maybe myfaces-impl doesn't get the file last-modified-time, because it resolves files as URLs, and a URL doesn't have a last-modified-time property, yeh? Or should I have to patch on myfaces-impl myself? )
Look on MyFaces Web Config Params
javax.faces.FACELETS_REFRESH_PERIOD is the standard param name.
This param is used on development time for rebuild the view, so you can change your page and check your changes on the fly. You don't need to set that on production. Try set it to -1 and that disables it. That works as expected, because in fact comes from original facelets code which is common to both jsf implementations. It is known that environments like Google Application Engine (GAE) does not allow get the file last-modified-time, but I don't believe that is your case.
精彩评论