aspose file tools*
The moose likes JSF and the fly likes Multiple GET calls happening when using Richfaces modal. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Multiple GET calls happening when using Richfaces modal." Watch "Multiple GET calls happening when using Richfaces modal." New topic
Author

Multiple GET calls happening when using Richfaces modal.

Amar Jarubula
Greenhorn

Joined: Jan 18, 2011
Posts: 5
When I am using a Richfaces modal I am seeing a lot of GET calls happening for the images, js, and the css included for that file and this happens for any action that occurs in the modal, say submit, hide, show etc.,. I have got this information from HttpWatch. Now why is this happening? Is this a default behaviour of JSF or Richfaces, or do I have to make some changes in my application to get rid of the calls. The images, js and css are in browser cache now which is not causing any server calls but if a user doesn't want anything to be cached then it would hit the performance of my application. For this reason I have to get rid of these calls. Please let me know any information regarding this.

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16142
    
  21

Whether it's modal or not, an HTML view that contains URL references is going to cause those references to be looked up via GET requests. That's not JSF, it's basic HTML.

While you can inline JavaScript and CSS - although this often isn't a very good idea - some sorts of resources simply cannot be embedded in HTML, and images are among that group. So images will ALWAYS require a GET to be resolved.


Customer surveys are for companies who didn't pay proper attention to begin with.
Amar Jarubula
Greenhorn

Joined: Jan 18, 2011
Posts: 5
I agree about what you said when it for the first time the call is being made. However in this situation these GET requests are happening every time on a reRender which is causing performance issues. For this reason I wanted to get rid of these. Initially I thought these is happening because of whenever Ajax submit is happening its taking a complete request, but later I figured its only partial request that happens at the level. While for a partial request there is no need for getting the images again from cache is what I am thinking. Correct me if I am wrong. If what I think is right, is there a way to get rid of these excessive requests?


Tim Holloway wrote:Whether it's modal or not, an HTML view that contains URL references is going to cause those references to be looked up via GET requests. That's not JSF, it's basic HTML.

While you can inline JavaScript and CSS - although this often isn't a very good idea - some sorts of resources simply cannot be embedded in HTML, and images are among that group. So images will ALWAYS require a GET to be resolved.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16142
    
  21

You'll have to exclude them from the reRender set. Otherwise RichFaces has no way to know if the images, &co. aren't dynamic and require a fresh copy. Client-side caching isn't something that the server can command or refuse, only suggest.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Multiple GET calls happening when using Richfaces modal.