1

If user refresh the page continuously using F5 functional key then the page loading is very slow and can be seen blank page for long time.

How to solve this problem?

I tried using cache on server side but I don't think that I am using it in proper way.

Can somebody help me with an example.

Abubakkar
  • 15,488
  • 8
  • 55
  • 83
Vinay
  • 111
  • 1
  • 3
  • 15

4 Answers4

0

I think you need to use browser cache, which can be controlled by http headers, or meta tags. http://www.mnot.net/cache_docs/

You need to set page cache to be around 5 seconds or some similar value so that no new request will be sent to server in that time interval.

Subin Sebastian
  • 10,870
  • 3
  • 37
  • 42
0

It is very difficult to stop user from pressing F5.

Try making your code more optimized. Use meta tags for cache like:

cache-control EXPIRES PRAGMA NO-CACHE

Also check this for JSP caching.

Community
  • 1
  • 1
Muhammad Imran Tariq
  • 22,654
  • 47
  • 125
  • 190
  • on every refresh the page gets loading all the images css and js this process is taking lot of time. – Vinay Dec 13 '12 at 07:32
0

A few things:

  1. You could try to minimize processing time within your application, maybe by minimizing wasteful operations. Sounds like your application spends a lot of time recreating the output.

  2. You could try to add some sort of caching on the server side, and and send the user the same page (ie no "new" processing) for some time. Depending on the mechanism, this may not be feasible though (https, security?). At least, afaik.

  3. Of course you could change the way the site works. You could use Ajax to push information to the site the user is on, and so take the urge to refresh away from him.

  4. And maybe your server just does not have enough power to serve a lot of users at the same time?

Scorpio
  • 2,309
  • 1
  • 27
  • 45
0

response.setIntHeader("Refresh",5); just use this jsp method for autorefreeshing of ur webpage... http://www.tutorialspoint.com/jsp/jsp_auto_refresh.htm

deepesh17feb
  • 87
  • 1
  • 1
  • 9