• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to cache the page to improve the performance

 
jack fe
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Our application embeds SAS generated html String with Java generated header and footer for the application report.
In our report pages, there are "Back" buttons which use history.back() to
call the same process on the server.
Clients can tolerate waiting a long time after pressing the "generate report" button for the report,
but cannot tolerate the "Back" button taking the same time as "generate report" button.
So I wander if the application can cache the SAS returned String or cache the whole report page
Some where only for "Back" button being pressed.
I do not want cache the html String in Session because I do not know how big the page is returned
by SAS.
By the way, the browser does not cache the page by using history.back() for some reason , any idea?

Thanks.
 
Stefan Evans
Bartender
Posts: 1822
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sure, caching the results of a long running process sounds a great idea.

A Map is a common datastructure for storing a cache in. LinkedHashMap in particular can bu used as an LRU (least recently used) map which is perfectly suited.

Or use a library such as ehCache.

Some questions to ask yourself
- do you want to cache the report for multiple users or just the current one?
- how much cache space do you want to use?
- how long should you cache things for?
- can objects in the cache get out of date? How long before they should expire?
 
Amit Ghorpade
Bartender
Posts: 2856
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
jack fe wrote:
By the way, the browser does not cache the page by using history.back() for some reason , any idea?



Did you check the browser settings?
Another reason is that the page might be using no-caching tags.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!