News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

MrPHP.com.au:
Image Cache using phpThumb and .htaccess
October 15, 2008 @ 11:12:14

Brett send in a link to a new post on his "Mr PHP" blog about a method he's come up with to cache images using the phpThumb library.

Generate thumbs by visiting a URL such as your.com/thumbs/images/image.50x50.jpg. This will create a 50x50px thumbnail of your.com/images/image.jpg. The thumb will be stored on your server at your.com/thumbs/images/image.50x50.jpg so the next request for the same image will be loaded without loading php for ultra fast image cache.

The phpThumb tool lets you dynamically resize an image and, if one does not exist for it, make a thumbnail that's output and cached. From then on the script just pulls from that local copy. He includes his code to get it working and the mod_rewrite rule that maps an image request back to it (so it's still "/images/myimage.jpg" instead of "/app/phpThumb.php?src=myimage.jpg&w=100&h=100" in the img src).

0 comments voice your opinion now!
image cache phpthumb modrewrite img src tutorial


blog comments powered by Disqus

Similar Posts

DevShed: Expanding the Application Range of Visitor Objects in PHP 5

9Lessons.info: Login with GitHub OAuth using PHP

ITNewb.com: PHP Encryption / Decryption Using the MCrypt Library (libmcrypt)

Gonzalo Ayuso: Combining Zend Framework2 and Symfony2 components with Composer to build PHP projects

NetTuts.com: Building With the Twitter API: Repeating Tweets From a Group


Community Events

Don't see your event here?
Let us know!


laravel interview middleware api wordpress voicesoftheelephpant series extension development podcast library conference unittest community language introduction laravel5 release opinion framework

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework