somewhere in... blog
x
ফোনেটিক ইউনিজয় বিজয়

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

১৪ ই নভেম্বর, ২০০৮ বিকাল ৩:৫২
এই পোস্টটি শেয়ার করতে চাইলে :

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:


# 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


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

পোস্টটি ভালভাবে দেখতে Click This Link ভিজিট করুন।

**আমাদের খুব শিঘ্রই কোড সাপোর্ট আনা দরকার।
সর্বশেষ এডিট : ১৪ ই নভেম্বর, ২০০৮ বিকাল ৩:৫৫
৫টি মন্তব্য ০টি উত্তর

আপনার মন্তব্য লিখুন

ছবি সংযুক্ত করতে এখানে ড্রাগ করে আনুন অথবা কম্পিউটারের নির্ধারিত স্থান থেকে সংযুক্ত করুন (সর্বোচ্চ ইমেজ সাইজঃ ১০ মেগাবাইট)
Shore O Shore A Hrosho I Dirgho I Hrosho U Dirgho U Ri E OI O OU Ka Kha Ga Gha Uma Cha Chha Ja Jha Yon To TTho Do Dho MurdhonNo TTo Tho DDo DDho No Po Fo Bo Vo Mo Ontoshto Zo Ro Lo Talobyo Sho Murdhonyo So Dontyo So Ho Zukto Kho Doye Bindu Ro Dhoye Bindu Ro Ontosthyo Yo Khondo Tto Uniswor Bisworgo Chondro Bindu A Kar E Kar O Kar Hrosho I Kar Dirgho I Kar Hrosho U Kar Dirgho U Kar Ou Kar Oi Kar Joiner Ro Fola Zo Fola Ref Ri Kar Hoshonto Doi Bo Dari SpaceBar
এই পোস্টটি শেয়ার করতে চাইলে :
আলোচিত ব্লগ

একজন বণিক, যিনি বদলে দিয়েছিলেন সমগ্র আরবের ইতিহাস

লিখেছেন সৈয়দ কুতুব, ০৮ ই জুন, ২০২৬ রাত ২:৪৩


মরুভূমির মাঝে দাঁড়িয়ে পুরো আরবকে বদলে দেওয়ার স্বপ্ন দেতেন একজন মানুষ। শুনতে পাগলামি লাগে, তাই না? কিন্তু সেই মানুষটা যদি ছোটবেলা থেকে কাফেলায় কাজ করে থাকেন, যদি তিনি জানেন... ...বাকিটুকু পড়ুন

কৃত্তিম বুদ্ধিমত্তা যেভাবে আব্বাসীদের জন্য হুমকি হয়ে আসছে- কী হবে খালেদ মহিউদ্দিনের?

লিখেছেন হিমন, ০৮ ই জুন, ২০২৬ রাত ২:৫০

হোমো ইরেক্টাসদের প্রায় বিশ লাখ বছর আগের আগুনের ব্যবহার থেকে শুরু করে ছয় হাজার বছর আগের চাকা আবিষ্কার, ১৮৩১ সালের বিদ্যুৎ, গত শতাব্দীর অ্যান্টিবায়োটিক, আর এই সেদিনের ইন্টারনেট ও স্মার্টফোন—... ...বাকিটুকু পড়ুন

আসলে কেউ ফেরে না।

লিখেছেন রানার ব্লগ, ০৮ ই জুন, ২০২৬ সকাল ৭:০৬

মৃতরা ফিরে আসে না।
ফিরে আসে তাদের ফেলে যাওয়া শূন্যতা,
চায়ের কাপের ধোঁয়া,
অধেক বলা কোনো কথা
অথবা হঠাৎ থেমে যাওয়া কোন সুর

যে প্রেম চলে গিয়েছিল,
সে আর কোনোদিন দরজায় কড়া নাড়ে না।
শুধু একদিন আয়নায়... ...বাকিটুকু পড়ুন

দ্য ড্রাগ কিং

লিখেছেন শাম্মী নূর-এ-আলম রাজু, ০৮ ই জুন, ২০২৬ দুপুর ১২:১৫


সতর্কবার্তা: এটি একটি সম্পূর্ণ কাল্পনিক ক্রাইম ফিকশন। বাস্তব একটি অপরাধের কাঠামোর ওপর ভিত্তি করে পাঠকদের জন্য এর চরিত্র, নাম এবং স্থান পরিবর্তন করে গল্পটি সাজানো হয়েছে।

খুলনা... ...বাকিটুকু পড়ুন

সামুতে আবারও লিলিপুটিয়ানদের সংখ্যা বেড়ে যাচ্ছে

লিখেছেন সত্যপথিক শাইয়্যান, ০৮ ই জুন, ২০২৬ দুপুর ১২:৫৮

আমার গত পোস্টে আলামিন১০৪ নামের এক ব্লগার মন্তব্য করেছেন যে - "এ আই দিয়ে হুমায়ূন আহমেদের মতো লেখা যায়।"
তিনি এ আই-কে প্রম্পট দিয়েছিলেন ' হুমায়ুন আহমেদের মতো গল্প লিখে... ...বাকিটুকু পড়ুন

×