ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:userguide:learn_caching:introduction

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
v5:userguide:learn_caching:introduction [2016/03/27 19:25] – created mnewnhamv5:userguide:learn_caching:introduction [2016/03/28 03:10] (current) mnewnham
Line 1: Line 1:
 +<-  ^ v5:userguide:userguide_index|List Of Tutorials ^ v5:userguide:learn_caching:disk_caching|Disk Based Caching ->
 +~~NOTOC~~
 ====== Caching Result Sets ====== ====== Caching Result Sets ======
 ===== Description ===== ===== Description =====
-The concept of caching is simple, in that it provides pre-processed result sets for oft-used queries (often referred to as static data). These result sets can be extracted from the database and provided in some alternate manner. In principle:+The concept of caching is simple, in that it provides pre-processed result sets for oft-used queries (often referred to as static data). These result sets can be extracted from the database and be provided to the end user in some alternate manner. In principle:
  
   * Eliminating repeated requests for static data reduces load on the the server and allows it to serve transactional data more efficiently.   * Eliminating repeated requests for static data reduces load on the the server and allows it to serve transactional data more efficiently.
  
 However, in practice, improvements in database servers, disk drives and memory have made it difficult to obtain improvements in performance unless: However, in practice, improvements in database servers, disk drives and memory have made it difficult to obtain improvements in performance unless:
-  * The performance of the underlying system is extremely poor, for example in Microsoft Access Database +  * The performance of the underlying system is extremely poor, for example in Microsoft Access Databases (although this is a poor solution in the first place for this kind of system). 
   * All incremental improvements are considered appropriate, for example in high-volume OLTP environments.   * All incremental improvements are considered appropriate, for example in high-volume OLTP environments.
  
Line 15: Line 17:
  
   - A traditional, simple disk based caching system that can be installed locally   - A traditional, simple disk based caching system that can be installed locally
-  - A remote system memory caching server based on memcached.+  - A remote memory caching server based on [[https://memcached.org/|Memcached]]
  
-===== System Requirements ===== +Once implemented, the coding methodologies are the same
-The directory where the queries are saved is controlled by the variable [[v5:reference:adodb_cache_dir|$ADODB_CACHE_DIR]] +
-===== Default Cache Secs ===== +
-The parameter ''$cacheSecs'' sets the default value of the time in seconds that cached queries are saved. If not set then the value is 3600. It can be set via either a normal connection object or a DSN type connection configuration. +
- +
-This default value can be overridden on a query by query basis +
- +
-<code php> +
-/* +
- * A connection object assumed +
- */ +
-$ADODB_CACHE_DIR = 'd:/queries'; +
-$db->cacheSecs   = 6000; +
-</code> +
- +
-{{tag>[cache]}}+
v5/userguide/learn_caching/introduction.1459099519.txt.gz · Last modified: 2017/04/21 11:40 (external edit)