Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Multiple GET calls happening when using Richfaces modal.

 
Amar Jarubula
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 18092
48
Android Eclipse IDE Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Amar Jarubula
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 18092
48
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic