If the query depends on user input than yes.
select(cache=(...)) uses the SQL QUERY as key. If it is possible for the 
QUERY that you are caching to always be different because depends on user 
this input you have a memory leak. Actually more than that. You have a DoS 
vulnerability because a user can keep making queries thus exploiting the 
leak easily.

You should only cache selects that do not depend on use input.


On Sunday, 4 August 2013 16:55:08 UTC-5, Loïc wrote:
>
> Thank you Anthony.
>
> Maybe I missed a point in the book, but does memory leak with cache.ram 
> also applies to select caching?
> For example when you do 
>
> rows = db(query).select(cache=(cache.ram,3600),cacheable=True)
>
> Is there any way to specify the key, or to empty the cache after some time?
> What is the "correct" way to do?
>
>
> Thank you
>
>

-- 

--- 
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