I solved the problem by using the following code:
@expose()
def index(self):
cherrypy.response.headers['Cache-Control'] = 'no-cache, no-
store, must-revalidate'
cherrypy.response.headers['Pragma'] = 'no-cache'
cherrypy.response.headers['Expires']= 0
raise redirect('anotherpage')
Now IE7 is not caching the page. We can redirect to a login page now.
I did not tested any other browsers yet.
Is it a relieable solution?
I would like to hear your suggestions.
On Jun 26, 10:09 am, Raj <[EMAIL PROTECTED]> wrote:
> I tried, as shown in the code below:
>
> @expose()
> def index(self):
> cherrypy.response.headers['Cache-Control'] = 'no-cache, must-
> revalidate'
> cherrypy.response.headers['Pragma'] = 'no-cache'
> raise redirect('anotherpage')
>
> But I did not got the desired result.
> The page is again chached by Firefox,IE6,IE7 etc.
> Whether my code has any mistake?
> Otherwise, how to disable cache?
>
> On Jun 23, 4:09 pm, Raj <[EMAIL PROTECTED]> wrote:
>
>
>
> > Thank You Richard Clark
> > I will try and inform the result
>
> > On Jun 23, 3:19 am, Richard Clark <[EMAIL PROTECTED]> wrote:
>
> > > import cherrypy
>
> > > Then put:
>
> > > cherrypy.response.headers['Cache-Control'] = 'no-cache, must-
> > > revalidate'
> > > cherrypy.response.headers['Pragma'] = 'no-cache'
>
> > > before return dict(...) in EVERY controller method you wish to prevent
> > > caching for. This information is freely available on the turbogears
> > > site, on the cherrypy site, and any number of other results under the
> > > google "turbogears cache control".- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---