Hello i have a problem with my website. It is running slow. I asked the my server provider why is that, and they replied its because the webiste uses many embedded urls like youtube, vimeo, dailymotion and so on. And so i have to cache these embedded urls. Anyone knows how to do that? I viewed this online. So all i have to do is put this code on my config page?
I downloaded the files. On the examble.php
what do iput on $contents?
<?php
include("php_fast_cache.php");
phpFastCache::$storage = "auto";
// ready ?
// check in case first
$content = phpFastCache::get("keyword1");
if($content == null) {
// for testing
echo "This is not caching, page is render with lot queires and slow speed <br>";
// do what you want, like get content from cURL | API | mySQL Query and return result to $content
$content = file_get_contents("http://www.phpfastcache.com/testing.php");
// rewrite cache for other request in 5 seconds
phpFastCache::set("keyword1",$content,5);
} else {
// use cache
// node
echo "THIS TIME USE CACHE, FAST! <br>";
}
echo "TRY F5 to refesh the page to see new SPEED with Cache!<br>";
echo $content;
why is this line? $content = file_get_contents("http://www.phpfastcache.com/testing.php");