- Joined
- Oct 4, 2009
- Messages
- 15
- Reaction score
- 10
Hello, i recently tested my site speed and saw the habbo images were slowing down my site! So i coded a caching script, and going to release it. This works for any cms, only needs a few manual changes to it. Any code improvements are welcome(I'm new to PHP)!
1.Make a folder called cache.
2.Create a file cache.php with content:
3.Change
And you're done!
Demo:
EDIT:Removed unused parts
1.Make a folder called cache.
2.Create a file cache.php with content:
PHP:
<?php
$figure = $_GET['figure'];
$action = $_GET['action'];
$direction = $_GET['direction'];
$head_direction = $_GET['head_direction'];
$gesture = $_GET['gesture'];
$size = $_GET['size'];
$imgFile = "$figure$action$direction$head_direction$gesture$size";
$imagesPath = $imgFile;
if(!file_exists(($imagesPath))) {
$otherSiteUrl = "http://habbo.com/habbo-imaging/avatarimage?figure=$figure&action=$action&direction=$direction&head_direction=$head_direction&gesture=$gesture&size=$size";
file_put_contents($imagesPath, file_get_contents($otherSiteUrl));
}
header("Content-Type: image/gif");
readfile($imagesPath);
?>
To view the content, you need to sign in or register
to
To view the content, you need to sign in or register
in all cms files (expect the caching script)And you're done!
Demo:
To view the content, you need to sign in or register
EDIT:Removed unused parts
Last edited:

