Hi,
you could use cache.ram or cache.disc. Start by replacing the
{{include 'footer.html' }}
with something like:
{{=response.render('footer.html', {your dict} )}}
and then wrap that like
{{=cache.ram( YOUR_KEY, lambda: response.render('footer.html', {your dict} ) 
, time_expire=YOUR_TIME_EXPIRE)}}
footer.html will be rendered either if the key hasn't cached already or it 
is no longer valid (expired).
Hope it helps

Paolo

On Wednesday, June 12, 2013 10:04:07 AM UTC+2, Annet wrote:
>
> In my application the header and footer of the layout, contain more or 
> less static information (navbar, address, social etc.) Since this header 
> and footer are shared by all users, their content is stored in a database. 
> The problem is that on every request the database is queried for this 
> 'semi' static content.
>
> I wonder whether it is possible to render the header and footer when the 
> user edits his navigation, address etc. in the cms and then store it in a 
> sub folder in the static folder and in layout.html have something like:
>
> {{include user_id_header}}
>
> {{include}}
>
> {{include user_id_footer}}
>
> where user_id_header and user_id_footer reference rendered .html files in 
> 'static/user_6/header.html' and 'static/user_6/footer.html' respectively.
>
>
> Kind regards,
>
> Annet
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to