The first argument in your cache decorator ( request.env.path_info ) is
the key that the cache system uses to determine uniqueness. If you
have a form in your view, then you need to insert all levels of
uniqueness into this key. Perhaps something like this...cachekey = str(request.env.path_info)+str(dict(request.vars))+str(request.args) @cache(cachekey,time_expire=20,cache_model=cache.disk)would do the trick. If the page is restricted based on authentication, you'll also need to include some sort of unique user identification in the cachekey variable. -tim voltron wrote: Thanks Massimo,The web2PY generic template is not displayed anymore. BUT I have a more serious problem, forms rendered in the cached view function are not validated and do not work anymore. Any ideas? Thanks On Jan 6, 5:55 pm, mdipierro <[email protected]> wrote:@voltron, ignore my original response. Tim pointed out the right issue. Correct your code as @cache(request.env.path_info,time_expire=20,cache_model=cache.disk) def index(): """ This action renders the feedback form """ response.view = "parents_normal_form.html" .... return response.render(dict(....)) ### this renders the template before caching. Massimo On Jan 6, 10:53 am, mdipierro <[email protected]> wrote: -- Timothy Farrell <[email protected]> Computer Guy Statewide General Insurance Agency (www.swgen.com) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" 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/web2py?hl=en -~----------~----~----~----~------~----~------~--~--- |
- [web2py:14613] Cacheing makes web2py "forget" te... voltron
- [web2py:14615] Re: Cacheing makes web2py "forget... mdipierro
- [web2py:14616] Re: Cacheing makes web2py "fo... voltron
- [web2py:14618] Re: Cacheing makes web2py &quo... mdipierro
- [web2py:14621] Re: Cacheing makes web2py ... voltron
- [web2py:14623] Re: Cacheing makes we... mdipierro
- [web2py:14626] Re: Cacheing make... Timothy Farrell
- [web2py:14627] Re: Cacheing ... mdipierro
- [web2py:14628] Re: Cacheing ... mdipierro
- [web2py:14669] Re: Cacheing ... voltron
- [web2py:14670] Re: Cacheing ... Timothy Farrell
- [web2py:14671] Re: Cacheing ... mdipierro
- [web2py:14673] Re: Cacheing ... DenesL
- [web2py:14675] Re: Cacheing ... DenesL
- [web2py:14716] Re: Cacheing ... Jonathan Benn

