$Db->TempCacheTimeout = 0 ..CONSOLE out shows cached ???

0 views
Skip to first unread message

TomH

unread,
Sep 10, 2010, 11:40:35 AM9/10/10
to TinyButStrong Next Version
Hello Skrol29;

A SMALL thing I notice -- that when using TempCacheTimeout = 0 in
order to prevent caching of a query that does a RAND() selection --
the CONSOLE display shows that the query result is cached -- although
rightly, the query is NOT being retrieved from cached.

I also just tested and find that that query is cached even if I
eliminate the CacheTimeout = 20; statement and trying to force default
of no caching.

Is that intended? Perhaps an unnecessary file write to disk for the
special case when TempCacheTimeout =0;

With the following pseudo code...
--------------------------------------------------------------------------------------------------------------------
$Db->CacheDir = "tbssql_cache";
$Db->CacheTimeout = 20;
$Db->CacheAutoClear = 20;
// some queries here under control of $Db->CacheTimeout=20;
...
...
// then
$Db->TempCacheTimeout = 0; // DO NOT cache - adverts query is a
RAND()
$adverts = $Db->GetRows($adverts);

--------------------------------------------------------------------------------------------------------------------
CONSOLE result indicates the adverts query is cached, see last line
below
----------------------------------
[Trace]: SELECT id,descript,thumbnail,url from adverts WHERE
position='advert' AND publish = 'all' ORDER BY RAND() LIMIT 4
# id descript thumbnail url
0 67 banners/dpcloth.jpg http://bdr-inc.com/
1 57 banners/flag-Ireland_advert100.jpg http://bdr-inc.com
2 56 banners/CoverBook.jpg http://bdr-inc.tomhenry.us
3 69 banners/sayc_join.gif http://bdr-inc.com/
[Trace]: Data saved in cache file tbssql_cache/
cache_tbssql_aa6e302e0377857e897c4b4afc150f61.php
----------------------------------


Cheers, and thanks for TBS every day,
TomH
Reply all
Reply to author
Forward
0 new messages