Archive

Archive for November, 2008

Website optimization 02: enable deflate /output compression (debian/ubuntu)

November 14th, 2008 2 comments

On the first post of this series we learned how to disable etags. in this post we will learn how to enable output compression.

Before enable this, let me introduce what deflate do. deflate is apache module, that main task is to compress all the output before serving or sending to client.

Nowadays most of the browser are enough expert to handle this. Here main technique is , apache will send the output in compressed format, after receiving this output your browser will uncompress it and render the formated output.

This tricks will really improve your site performance, because user will get your site with less time and bandwidth.

Let me give you an example: let’s think if you are using jquery javascript library that size is 94 Kilo bytes, but if you enable the deflate with default configuration, it will be only 14 Kilo bytes. unbelievable right ? believe me, it’s true. And we are using this on our most popular product http://www.somewhereinblog.net .

OK, now i am showing how you will do this:

first of all you need to enable deflate module. You know i am debian fan, so i am giving commands for debian linux, other linux/unix commands will almost same. as ubuntu is comes from debian, these commands will also work for ubuntu

Open a new terminal and give this command.
sudo a2enmod deflate

it will enable deflate. Wait, you are not finish yet. little work left.
create new file called deflate.conf in your apache conf.d folder. and paste the following code:
<Location />

# Insert filter
SetOutputFilter DEFLATE

# Netscape 4.x has some problems…
BrowserMatch ^Mozilla/4 gzip-only-text/html

# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip

# MSIE masquerades as Netscape, but it is fine
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
# Don’t compress images
SetEnvIfNoCase Request_URI \
\.(?:gif|jpe?g|png)$ no-gzip dont-vary

# Make sure proxies don’t deliver the wrong content
Header append Vary User-Agent env=!dont-vary

</Location>

save the file, and restart apache.

sudo /etc/init.d/apache2 restart

that’s all. now you can see the different.

**if you have not enabled header module of apache, please remove the line “Header append Vary User-Agent env=!dont-vary” from deflate.conf .

For more customization or option of deflate, please visit http://httpd.apache.org/docs/2.2/mod/mod_deflate.html

Views :14219

WordPress with full bangla language support

November 8th, 2008 26 comments

Day by day more blog are coming. It’s really great news for everyone. As lot’s of bengali are asking me about WordPress bangla language file. here it is 🙂 .

In this post i wrote a little “howto” to translate or use WordPress in bangla.

First of all you need to checkout latest language pack form meghdut site.

Open your terminal and give the under given command (if you already installed subversion otherwise search google how to install subversion)

svn co http://svn.automattic.com/wordpress-i18n/bn_BD/trunk/messages/ .

This command will checkout latest language pack from subversion repository. or you can open http://svn.automattic.com/wordpress-i18n/bn_BD/trunk/messages/ in your browser and right click on bn.mo file and select “save link as”.

Now you need to upload these files to your WordPress installed directory.

First make a folder called languages in wp-includes/ then upload these files to that language files.

Or if you are maintaining you WordPress (that i always suggest) then enter to that language folder then execute this command

svn co http://svn.automattic.com/wordpress-i18n/bn_BD/trunk/messages/ .

it will download latest langugage pack from subversion repository. more over if the repository file updated just run “svn up” on languages folder, it will get latest update from repository.

Now you need to configure your WordPress to use this new language files. so edit your wp-config.php file that you will get in the root folder of your WordPress directory.

replace define (‘WPLANG’, ”); with define (‘WPLANG’, ‘bn_BD’);

save it , done 🙂

open your blog in any browser and see the magic 🙂

**all the string will not comes with bangla, you will need to edit some values from your admin panel also, like the titles of widgets.

If you have time please visit this page and help them to translate WordPress 🙂

For writing bangla, you will need the bangla writing plugin that you will get here.

**i wrote this tutorial in short time, so may have some mistake, please inform me in comments.

Views :19096
39 queries in 0.469 seconds