CodeCanyon AutoCache 1734137

CodeCanyon AutoCache 1734137

CodeCanyon AutoCache 1734137
PHP Script \ Miscellaneous
Cache \ Static \ Query \ Page \ Class \ Accelerator



PHP Script - AutoCache 1734137 by Savetheinternet @ CodeCanyon

PHP Script \ Miscellaneous

Last Update: 17 March 12; Software Version: PHP 5.x; Files Included: PHP.

Introduction
AutoCache is what the name implies: automatic cache.
Regardless of the web application you’re using, AutoCache should be able to speed it up. It will sit between PHP and your PHP web application and watch what data passes by, so that if there is a duplicate request in the future (within a set timeframe), then instead of letting the app run its course again, we’ll serve a saved/cached response instead. This means less database queries and less processing per request (as pulling an object from cache usually takes < 1ms).

Implementation
To implement AutoCache, all you need to do is add a few lines of code to the top (or near the top) of your script. The positioning is irrelevant as long as nothing is shown to the client and no HTTP headers are sent before you call AutoCachePush() or AutoCachePullOrPush() .
Examples

<?php
require 'auto-cache.php';
AutoCacheHash($_SERVER['REQUEST_URI']);
AutoCachePullOrPush(5);

The above script will make any requests with the same URI to be considered the same object. The object will stay cached for a maximum of 5 seconds (that’s the TTL ¡ªtime to live). Any other requests within 5 seconds of another request of the same URI will be served from cache.

If your content differs per IP address or cookie, simply use something like this.

<?php
require 'auto-cache.php';
AutoCacheHash($_SERVER['REQUEST_URI']);
// Don't serve the same content for different IP addresses.
AutoCacheHash($_SERVER['REMOTE_ADDR']);
AutoCachePullOrPush(5);

Or…

<?php
require 'auto-cache.php';
AutoCacheHash($_SERVER['REQUEST_URI']);
// Different "username" cookie, different object.
AutoCacheHash($_COOKIE['username']);
AutoCachePullOrPush(5);

qForms; ToSQL - JSON/XML/PHP to SQL; PHPsh - PHP Terminal; Advanced PHP Template Preprocessor.

Keywords: accelerator, cache, cache class, page cache, query cache, static cache, web cache.



Tags: Cache, Static, Query, Class, Accelerator, AutoCache

Premium CodeCanyon AutoCache 1734137 WordPress Themes, Website Templates, Mobile Themes, Flash Templates & Scripts from creative professional designers. Full details of CodeCanyon AutoCache 1734137 for digital design and education. CodeCanyon AutoCache 1734137 desigen style information or anything related.

Comments:

Name:*
E-Mail:*
Add Comments:
Enter Code: *