• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Caching problem.

 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi I have a caching problem.

JSp page bb.jsp construct a String from request parameter ,that is then passed to a custom tag.

I have the following code in bb.jsp

<% response.setHeader("Cache-Control","no-cache");
response.setHeader("Pragma","no-cache");
response.setDateHeader ("Expires", -1);
response.setHeader("Cache-Control","no-store"); //HTTP 1.1
%>

The first time the parameter value is passed.

Now the second time , I change the parameter value . But bb.jsp is rendered , it is still showing the first parameter value . How can i see the new value ?

I dont think this is Browser refresh problem because I open the page from 2 seperate browser . The second browser still shows value of parameter that was passed from first browser.

The code

Url -1: bb.jsp?configfile=valid.xml
Url -2: bb.jsp?configfile=Invalid.xml

bb.jsp:
===
<% response.setHeader("Cache-Control","no-cache");
response.setHeader("Pragma","no-cache");
response.setDateHeader ("Expires", -1);
response.setHeader("Cache-Control","no-store"); //HTTP 1.1
%>

<% String s1 = request.getParameter("configfile");
opsession.setConfigFileName (s1); %>

====

Thanks a lot
[ September 07, 2006: Message edited by: Ram Gokul ]
 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,You might find this useful.
http://support.microsoft.com/kb/q222064/
 
Bartender
Posts: 1845
10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your no-cache tags look fine to me.
As an experiment - try refreshing your page and see if it changes. If it does, you have a cache issue, if not, then the issue is elsewhere.

I think you need to show some more code.
What is the variable opsession? Where is it declared? Is it a bean? What scope?
Where do you print out its value?

At a guess, I think you are using <%! declaration %> area, which is not thread safe. Either that or session variables which are not being set properly.
 
Who among you feels worthy enough to be my best friend? Test 1 is to read this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic