Forums Sign Up Reply Search Statistics
Fast Template GraFX Software Solutions - Forum / Fast Template /

Cache enhancement request

 
Author rr1024
Forums Member
#1 Posted: 21 Nov 2007 20:03:07
Reply 
I was thinking that it maybe nice to have the cache for a single file to also allow for the same file with xtra parameters.

basically creating a cache for search results as an example. In other words if there is away to create a cache for a template or group of templates then also allow the template or group of templates with "special parameters appended"

Let say I have a link exchange script with catagories A, B, C and URI would be index.php?cid=1 or 2 or 3

I would want an independant cache file for
index.php the cached file could be 6d67a0de894e0179548e50c7fc3d0b39.ft

index.php?cid=1 the cached file could be 6d67a0de894e0179548e50c7fc3d0b39_1.ft

index.php?cid=2 the cached file could be 6d67a0de894e0179548e50c7fc3d0b39_2.ft

index.php?cid=3 the cached file could be 6d67a0de894e0179548e50c7fc3d0b39_3.ft

Or some such thing, I think this would be very, very useful
Author software
Admin
#2 Posted: 22 Nov 2007 08:59:35
Reply 
It is not something like this what you looking for?
http://www.grafxsoftware.com/forum/10_734_0.html

You can go more deep, like menu_cat1.html, menu_cat2.html for example, we tried to cache with USE_CACHE, but that generate the whole page and is OK ONLY when you don't have dinamic data what change from time to time. For example if you have a login in the page, all is gone, cause then cache will be show to all with user login.

So use partial cache is like in that small example and if you need for each category a new page, then use menu_cat1.html, menu_cat2.html where the number is the category ID.
We use this in a site where when I'm in a category page, I show the category in different color and BOLD, so we need for each category a cached menuxx.html.
Hope this help.
Author software
Admin
#3 Posted: 22 Nov 2007 13:19:19
Reply 
self_script function is taking the URI, as well.
So /test_url.php?aa=s&ak=0 should be the filename.
If argv is turned on the vars will be shown, as well
$fname .= join("_and_", $q);
Author rr1024
Forums Member
#4 Posted: 23 Nov 2007 04:25:51
Reply 
Great I just reviewed the code for that section...that seems to work great!


The only issue I see with it is when the a user / visitor tries to plug in non valid URI componets in a hacking attempt which could result in invalid caches created. However with resonable expireation times a cron job could be crated to remove the incorrectly formated or old files.

I think what you have will work great but one should create a cron job to remove old and uri files that where created by the hackers.
Author software
Admin
#5 Posted: 23 Nov 2007 11:33:54
Reply 
You can try function $ft->DELETE_CACHE($time);

$time = whatever you want.
 
Your Reply

» Username  » Password 
Only registered users are allowed to post here. Please enter your login/password details upon posting a message, or sign up first.