Click here to Skip to main content
11,577,965 members (63,749 online)
Click here to Skip to main content

Tagged as

Caching Output in PHP

, 30 Mar 2010 CPOL 2K 1
Rate this:
Please Sign up or sign in to vote.
You should not define the object identifyer at the top of each page (because then you have to write out the same bit of code each time u want to access a object within a class.- (Insted Use a included class)Cachecache_class.phpExample Classclass Cache {function...
You should not define the object identifyer at the top of each page (because then you have to write out the same bit of code each time u want to access a object within a class.

- (Insted Use a included class)

Cache
cache_class.php
Example Class
class Cache {
function cache_start(){
// Start Cache CODE
}
 
function cache_end(){
// End Cache Code
}
 
}

At the bottom of the class we will need to add the object identifyer, this is a much better way of using objects within our class because rather then defining object identifyers all the time we can just define one identifyer.

Once we include the file which contains our php cache class we can then use the functions which we have just created to enable cache.


$cache = new Cache();

Using Objects Within The Class
include('includes/cache.php');
 
$cache->start();
 
$chache->end();

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Rockyonfire
United States United States
No Biography provided

You may also be interested in...

Comments and Discussions

 
Generali used a cache class but i found that i rather not use the o... Pin
simplu13-Jun-10 4:11
membersimplu13-Jun-10 4:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.150603.1 | Last Updated 30 Mar 2010
Article Copyright 2010 by Rockyonfire
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid