« Back to IP Phone Services Questions

java +jetty +EXPIRES header

Combination View Flat View Tree View
Threads [ Previous | Next ]
i all,
 
I'm trying to set expires header correctly on the pages, to the old date. so that ip phone does not keep it in cache.
I set it via the following way:
 
        response.setContentType("text/xml");
        response.setHeader("Cache-Control", "no-cache");
        response.setDateHeader(HttpHeaders.EXPIRES, HttpFields.parseDate("Sat, 26 Jul 1981 05:00:00 GMT"));
        response.setHeader("Pragma", "no-cache");
        response.setDateHeader("Max-Age", 0);
        response.setStatus(HttpServletResponse.SC_OK);
 
and I can see in the wireshark traces that it's correctly set. file attached.
 
but when someone clicks the back key (SoftKey:Exit) it still navigates to that page.
 
can anyone tell me what I'm doing wrong?
 
Thanks,
Attachments:

RE: java +jetty +EXPIRES header
Answer
6/14/12 1:37 PM as a reply to George Goglidze Berdzenishvili.
Hy outh there

i only do this in my code

response.setDateHeader("Expires",-1);

and this is working.
Maybe this is helping

cheers Floh

Hi,

Thanks for your answer Florian! I have tried that as well, but it does not work unfortunately. emoticon

I do not know what else to do to make it work.

RE: java +jetty +EXPIRES header
Answer
6/14/12 3:56 PM as a reply to George Goglidze Berdzenishvili.
What IP phone you use?
Do you set the AppId tag?

Hi Sergei,

Yes, I am in fact setting the appID flag...

for example:

msg += "<CiscoIPPhoneMenu appID=\"MY/APP\">\n";

RE: java +jetty +EXPIRES header
Answer
6/14/12 7:47 PM as a reply to George Goglidze Berdzenishvili.
it's fixed now!!!!

I didn't realize I had to set the Date header as well for Expire header to work emoticon)))

here's the code finally:

Date dt = new Date();
response.setDateHeader("Date",dt.getTime());
dt.setTime(dt.getTime() - 60000);
response.setDateHeader("Expires",dt.getTime());

now it all works fine! emoticon)))

Thanks all for your help,