So when you use the cache decorator on a controller, it only caches the
controller output...not the rendered view? If someone wanted to cache the rendered view, how would they do that? -tim mdipierro wrote: Because you override the view in the action which is not executed when cached.To fix it, outside the index function add if request.function=='index': response.view = "parents_normal_form.html" Massimo On Jan 6, 10:07 am, voltron <nhy...@googlemail.com> wrote:I used disk and RAM, like I mentioned above, no errors except that it shows web2pys generic template instead of the one I declared On Jan 6, 3:49 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:Do you get the error using cache.ram instead of cache.disk? How does the problem manifest? Do you get an empty page? An error? Can you add a print statement to check whether the controller is executed when you see the error?Why are you using cache.disk over cache.ram? The former involved picklying so the latter is much faster.massimoOn Jan 6, 8:09 am, voltron <nhy...@googlemail.com> wrote:Here is an example:@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"page_title = T("Feedback") page_content = """On Jan 6, 3:07 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:Can you provide an example of how you caching a page so that I can try reproduce this?MassimoOn Jan 6, 6:19 am, voltron <nhy...@googlemail.com> wrote:I have a bad problem at the moment, all the views that use cacheing sometimes default to web2py generic template sporadically then are then correct after a refresh. I set the template in the views as such# Exampleresponse.view = "accounts/register.html"Is there some workaround for this?Thanks -- Timothy Farrell <tfarr...@swgen.com> 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 web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com 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