Page 1 of 2

[RC2] phpBB2 Native SQL Caching (1.1.0)

Posted: Fri Jun 30, 2006 10:11 pm
by tunafish
phpBB2 Native SQL Caching
Current Version 1.1.0

_______________________________________________________

Note
As the original author of this mod has been banned i have taken over this project and continued development.

_______________________________________________________

Contributions
Any contributions made by third partys and posted in this thread will get a link in think section of the post, i will check this thread daily.

_______________________________________________________

About
With this modification installed you will be able to cache sql queries for faster page generation times and less database usage, the following can be done with this method.

_______________________________________________________

What is SQL caching?
This mod will add an additional parameter to the sql_query function of the sql_db object, this parameter will tell the query to use php files to store queried data for the specified about of time (3hrs by default, you may use a config var to store an alt number) in a php file as a serialized string, this will improve the performance of your forum as done in phpBB3 by reducing the load put onto the mysql service.

_______________________________________________________

How to cache a query!
To cache your SQL query you simply add a cache handle to your sql_query function.
This is your standard query

Code: Select all

$db->sql_query($sql)
This is your standard query (transaction applied)

Code: Select all

$db->sql_query($sql, true)
This is your cached sql query

Code: Select all

$db->sql_query($sql, true, 'cache_name')
As you can see, its as simple as adding that extra parameter to the function, as this mod develops i will also provide a toolkit to cache the most important queries in phpBB.

_______________________________________________________

Config keys
sql_cache_dir: Custom caching directory
sql_cache_expire: Custom caching time (in seconds) default: 3hrs

_______________________________________________________

Download Mirrors
[1.1.0] http://www.gotbase.org/mod_sql_caching_110.zip (Thanks A.I. BOT)
[1.1.0] http://www.extremephpbb.com/mods/mod_sq ... ng_110.zip (Thanks danb00)
[1.0.0] http://gotbase.org/mod_sql_caching_100.zip (Thanks A.I. BOT)

_______________________________________________________

Change Log
Changes for each version of this mod
  • Version 0.1.0
    • # Stable Release
    Version 1.0.0
    • # Reviewed and submitted to MOD-DB, Forgot about the transaction param, readded.
    Version 1.1.0
    • # Created caching class
      # Cleaned up the code a little
      # Added optional config directives
      # MOD Takeover by tunafish

Posted: Fri Jun 30, 2006 11:08 pm
by Ramon Fincken
good luck with your project.

however make sure you mirror the download url !

Rfn

Cache Manager

Posted: Fri Jun 30, 2006 11:41 pm
by NGLeader
Hi, tunafish.

See my post in this thread, about making this as a phpbb cache manager.

Posted: Sat Jul 01, 2006 3:36 pm
by igorw
Glad to see good MODs being continued!

Posted: Sat Jul 01, 2006 10:38 pm
by tunafish
When i can i will write a cache class to also cache templates.

Posted: Sun Jul 02, 2006 8:18 am
by igorw
Like eXtreme Styles?

Posted: Sun Jul 02, 2006 8:20 am
by tunafish
Yep, but a little less advanced, it will just put template data into a string instead of making actual php files like XS.

Posted: Mon Jul 03, 2006 6:10 am
by tunafish
New version is now available.

Posted: Wed Aug 23, 2006 7:04 am
by amir abbas
excuse me in which folder queries will cach ?
in cach folder ? :roll:

Posted: Wed Aug 23, 2006 7:09 am
by amir abbas
excuse me in which folder queries will cach ?
in cach folder ? :roll:

Posted: Wed Aug 23, 2006 1:36 pm
by PastisD
Config keys
sql_cache_dir: Custom caching directory

Posted: Thu Aug 24, 2006 3:26 am
by tunafish
if the config key is not said in the /cache directory.

Posted: Thu Aug 24, 2006 9:41 am
by danb00
This mod is usefull very usefull. Just wondering does it cache the phpBB version updater?

Posted: Thu Aug 24, 2006 1:09 pm
by tunafish
No it does not.

Posted: Wed Sep 13, 2006 7:29 am
by EzerchE