Ask To Apps
  • Home
  • WordPress
  • Elasticsearch
  • PHP
  • Linux
  • Website Peformance

Tag : performance

Website optimizations techniques: Increase page load time and performance.

19/02/2014 Article

For increase website page load time and maximum throughput. I have listed following techniques to implement. Those will really help to get fast page load time of webpage. I have also mentioned some reference links for implement those techniques.

Minify CSS

Minify CSS – Always minify CSS code, it remove comments and white space. This reduces size of file at the end. You can use following sites to minify css. Don’t write duplicate css class, use less css for writing organized css.

  • http://refresh-sf.com/yui/
  • http://cssminifier.com/
  • http://www.minifycss.com/
  • http://lesscss.org/

Minify JS – This will also help to reduce page load time.

  1. Remove unused JavaScript functions/code.
  2. Put JavaScript file at the end of page, may be in footer area.
  3. Minify JavaScript files.
  4. You can use small JavaScript apis/libs for reduce code. e.g. AnguarJs, Latest JQuery etc.
  • http://refresh-sf.com/yui/
  • http://www.jsmini.com/
  • http://jscompress.com/
  • http://angularjs.org/
  • http://jquery.com/

Third party calls

Load external, third party http calls asynchronously. e.g. social api’s i.e. facebook, twitter, ads etc.

Use ETags

Its For client side cache. You can easily set etags on pages using .htaccess. Put following code into .htaccess.Watch Full Movie Online Streaming Online and Download

FileETag MTime Size
<ifmodule mod_expires.c>
  <filesmatch “\.(jpg|gif|png|css|js)$”>
       ExpiresActive on
       ExpiresDefault “access plus 1 year”
   </filesmatch>
</ifmodule>

Set expiry headers

We can easily do that by putting following code in .htaccess

<FilesMatch “\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)(\.gz)?$”>
Header set Expires “Thu, 15 Apr 2030 20:00:00 GMT”
</FilesMatch>

Lazy load images

If web page having more images, that can cause page load time. For this we can use lazy loading techniques. That is only display images those are on above the fold position of website and loads other images when user scrolls down. This can easily doable via following libraries.

  • https://plugins.jquery.com/lazyload/
  • http://www.appelsiini.net/projects/lazyload

Use static html pages watch full movie The Lego Batman Movie 2017 online

If you website has content which is not frequently changes then you can use static html pages to server. It will reduce server side bandwidth and page loads quickly. One quick option you can do it like – Cache PHP response in static file only in 10 line of code

Reduce DOM element count which eventually reduces Dom processing time.

Implement Sub domains

Web Browser has capability to send 6-8 concurrent http request, till the time other request keeps on hold till those complete. So it will halt page during that period. For that you can use subdomain request to act as different http requests.

e.g. We can configure apache to server different type of request using different sub domains.

  • www.asktoapps.com
  • images.asktoapps.com
  • js.asktoapps.com
  • css.asktoapps.com
  • ajax.asktopapps.com

HTML should be W3C standards

  • http://www.w3.org/standards/

Reduce DNS lookup and HTTP request.

Use sprite image for static images in web page.

  • Here is link where you can create sprite image from set of images – http://spritegen.website-performance.org/

Use CDN – For cache http request on edge level. We must use cdn.

 

Categories: PHP, Website Peformance, Wordpress

Tags: increase page load time, performance, website optimization

About Author:

Cache PHP response in static file only in 10 line of code

13/10/2013 Article

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 = &amp;quot;cache/&amp;quot;.md5($_SERVER['REQUEST_URI']);

//Purge Old Cache
if(@file_exists($key)){
$minutesBefore = (time()-@fileatime($key))/60;
if($minutesBefore&amp;amp;gt;$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

Tags: cache, optimization, performance, php performance, static cache

About Author:

Elasticsearch Installation and Configuration

25/03/2013 Article

Elasticsearch is …

  • Open Source (Apache 2)
  • Distributed
  • RESTful
  • Search Engine built on top of Apache Lucene.

It is …..

  1. Very fast
  2. Schema Free
  3. JSON over HTTP
  4. Scale to hundred and real time search.

 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

Tags: Apache Lucene, Distributed, Elastic Index, Elasticsearch, JSON over HTTP, Linux Commands, Open Source, optimization, performance, real time search, remote sync, RESTful, Scale, Schema Free, Search Engine, Search Index, Very fast

About Author:

Recent Posts

  • Install and configure logstash-forwarder
  • Redirect request on php script through squid proxy
  • Alerting for Elasticsearch : Log watcher in elasticsearch using ES Watcher
  • Detect face from image using python script with OpenCV
  • Change mysql root password on centos
  • Search part of word in elasticsearch using nGram – auto-complete search
  • Connect VPN on centos linux using command line
  • Custom river plugin in elasticsearch
  • Backup elasticsearch with snapshot and restore api
  • PHP code to exact keywords from text.

Tags

apache Apache Lucene cache Distributed Elastic Index Elasticsearch elasticsearch performance Git Clone Git Hub Git Hub Configuration Git Hub Installation grep Import Install MySQL JSON over HTTP Linux Linux Command Linux Commands Linux search local file lsyncd md5sum Multile Domain Multisite MySQL Open Source optimization performance php performance real time search remote file Remote Git Hub remote sync RESTful Scale Schema Free Search Engine Search Index Search keyword static cache Sub Domain sync Very fast Wordpress Wordpress multisite

Copyright Ask To Apps 2022 | Proudly powered by WordPress

facebook twitter google linkedin Email Rss