Tag : optimization
Tag : optimization
There are lot of techniques where you can optimize your php script. Here is simple and very easy example to get faster php response using file based cache in 10 line of code.Watch Full Movie Online Streaming Online and Downloadmovie War for the Planet of the Apes
You can use it mainly for ajax calls.
//Cache TTL(When to purge static file) in minutes $ttl=10; //Unique Cache Key $key = "cache/".md5($_SERVER['REQUEST_URI']); //Purge Old Cache if(@file_exists($key)){ $minutesBefore = (time()-@fileatime($key))/60; if($minutesBefore>$ttl){ @unlink($key); } } //Get Cached Content if(@file_exists($key)){ echo @file_get_contents($key); exit; } //Write Into Buffer ob_start(); //Your code //..... $content = ob_get_contents(); ob_clean(); //Create new cache i @file_put_contents($key,$content); //Print response content; echo $content;
Categories: Linux, PHP, Website Peformance
Elasticsearch is …
It is …..
 Installation
Elasticsearch is based on java, so we need to install JAVA>6
yum install java-1.7.0-openjdk.x86_64
java -version
Download source from
wget https://download.elasticsearch.org/
elasticsearch/elasticsearch/elasticsearch-0.20.5.tar.gz
tar -xvf elasticsearch-0.20.5.tar.gz
cp -r elasticsearch-0.20.5.tar.gz elasticsearch
cd elasticsearch
Add elastic home path in “.bash_profile”
export $ES_HOME=/home/elasticsearch
Start/Run Elasticsearch
cd elasticsearch
bin/elasticsearch -f
Is it started?
You can confirm it by browsing URL like - http://127.0.0.1:9200/, it will shows something like
{
"ok" : true,
"status" : 200,
"name" : "Neville, Kate",
"version" : {
"number" : "0.20.5",
"snapshot_build" : false
},
"tagline" : "You Know, for Search"
}
Categories: Elasticsearch, Linux, Website Peformance