Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JSP and Ajax  RSS feed

 
deepti bellubbi
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a doubt.. please clarify..
if I have a page with many drop-downs and each is being populated with Ajax calls from db, how can I cache the page so that everytime the combo-boxes need not require calls to db..but can access the cache?

Thanks in advance

Deepti
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66141
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't cache the page, but you can cache the data for the DB calls. This should happen in your data access layer, not in your presentation layer.

If you want the whole page to be cacheable, including the dropdown values, don't use Ajax.
 
deepti bellubbi
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:You can't cache the page, but you can cache the data for the DB calls. This should happen in your data access layer, not in your presentation layer.

If you want the whole page to be cacheable, including the dropdown values, don't use Ajax.



Thanks ...also could you please elaborate that when we implement JSP caching.. what exactly is cached.. actually its a bit of confusion as to what is the difference between precompiled jsp and cached jsp?

thanks again!
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A precompiled JSP is just a JSP that's already been compiled. That has nothing to do with caching.

As Bear said, if you want to cache a page with the dropdown values, you can't use Ajax. Also as he said, *data* caching should be handled in the data layer.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!