Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with browser caching

 
Pranav Bhatt
Ranch Hand
Posts: 284
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'am working on a pagination problem. I am posting data from my Action class to the display JSP and when user press Next link again flow goes to Action class then to same JSP again with new data.

i have used the rownum query in action and it keeps changing the lower_bound and upper_bound with every call to execute() in my action as below-:


with each call from my jsp with Next link .

All is working fine but am getting the rows appended with previous rows in my JSP. That is for first request am getting 15 rows. Again a click on Next is giving me 30 rows with 15 new rows appended to previous 15. I tried to clear browser cache as below but it doesn't seem to work-:


My URL is not same for every query as my page parameter value is getting changed every time still its not working as expected.

I had put a output statement on Action class, just to be sure am getting result in incremental sets. It seems fine from below result of two consecutive calls-:



Please inform i did not make my point clear. i tried this in Mozilla, IE , both gives same result.

Anyone having any idea how to get around this...
 
Pranav Bhatt
Ranch Hand
Posts: 284
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks i have solved it.. Its working now..
 
Ankit Garg
Sheriff
Posts: 9521
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its good to know that its working. Well these are the response headers that I use to prevent caching

 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All other cache-control fields are pointless when no-cache is specified.
 
Mark Williams
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My question probably depends on the client but, what effect do these no cache headers have on images referenced in the HTML? It should be none right? I am thinking that the no cache header only applies to the HTML and not the objects that the HTML tells the browser to request.
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Images are obtained by fully separate and independent requests fired by the webbrowser itself after examing the 'src' attribute.
 
Mark Williams
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bauke Scholtz wrote:Images are obtained by fully separate and independent requests fired by the webbrowser itself after examing the 'src' attribute.


So, I will assume that the headers are not stopping the browser from caching images on the page. Thanks.
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Indeed. The response headers only applies on the current request/response and certainly not on others.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic