DIY মিডিয়া হোম লোগো

আপনার নিজের হোম থিয়েটার এবং হাই ফাই সেটআপ নকশা ও নির্মাণের জন্য চূড়ান্ত সাইট.

0ভিপিএস বদলান ওয়েব পারফরম্যান্সের উন্নতি করতে

যতক্ষণ আমি অনেক নতুন নিবন্ধ সম্প্রতি লেখেননি আমি যথেষ্ট সময় ব্যয় করেছেন আপডেট করা এবং জিনিস পর্দার পেছনের দিকে সংশোধন, যথা বিভিন্ন নিরাপত্তা (TLS,) সেটিংস আমার ভিপিএস এই এক সহ বিভিন্ন সাইট হোস্ট করে। আরেকটা জিনিস আমি সম্প্রতি উন্নত কাজ করেছি gzip, এর আমার ব্যবহার উন্নতি, এবং একটি নতুন বিন্যাস brotli নামক

সংক্ষেপে, gzip, (এবং brotli) can be used to com­press resources before they are sent to the browser, যা পাঠানো পরিমাণ ডেটা হ্রাস, and hence should mean a site loads faster. The down­side is that com­press­ing resources takes time, which could out­weigh the gains from the smal­ler sizes. The ideal solu­tion is to have resources com­pressed in advance, rather than com­pressed by the http serv­er in real­time. Most of my web­sites use word­press which con­tains lots of files in plu­gins, থিম ইত্যাদি, so going through all of these and manu­ally com­press­ing them everytime there is an update would be imprac­tic­al. The answer is to use a script which mon­it­ors the sys­tem for file changes, and cre­ates com­pressed files as needed. Below is the script I have recently writ­ten to do exactly this.

#!/bin/bash                               

inotifywait -m -q -e CREATE -e MODIFY -e MOVED_TO -r "/var / www /" --বিন্যাস "%W% চ" --excludei '।(JPG|PNG|GIF|ico|লগ ইন করুন|SQL|ফ্যাস্ শব্দ|GZ|পিডিএফ|পিএইচপি|SWF|TTF|EOT|woff|CST|JST|বিআর|CTS)$' |
while read file
do
if [[ $ফাইল = ~ \.(সিএসএস)$ ]];
then
fname="${% দায়ের। *}"
যদি [ -চ "$fname".min.css ]
then
rm -f $file.gz
rm -f $file.br
zopfli --gzip $file
bro --quality 11 --input $file --output $file.br
chmod 664 $file.br
chmod 664 $file.gz
chown wordpress:wordpress $file.br
chown wordpress:wordpress $file.gz
else
rm -f $file.gz
rm -f $file.br
cat $file | cleancss > $fname.cst
cat $file | cleancss | ভাই --quality 11 --output $file.br
zopfli --gzip $fname.cst -c > $fname.css.gz
chmod 664 $file.br
chmod 664 $file.gz
chown wordpress:wordpress $file.br
chown wordpress:wordpress $file.gz
rm -f $fname.cst
fi
fi

if [[ $ফাইল = ~ \.(JS)$ ]];
then
fname="${% দায়ের। *}"
যদি [ -চ "$fname".min.css ]
then
rm -f $file.gz
rm -f $file.br
zopfli --gzip $file
bro --quality 11 --input $file --output $file.br
chmod 664 $file.br
chmod 664 $file.gz
chown wordpress:wordpress $file.br
chown wordpress:wordpress $file.gz
else
rm -f $file.gz
rm -f $file.br
uglifyjs $fname.js > $fname.jst
zopfli --gzip $fname.jst -c > $fname.js.gz
bro --quality 11 --input $fname.jst --output $file.br
chmod 664 $file.br
chmod 664 $file.gz
chown wordpress:wordpress $file.br
chown wordpress:wordpress $file.gz
rm -f $fname.jst
fi
fi

origfs=$(wc--c < "$ফাইল")
gzfs = $(wc--c <"$file.gz")
brfs = $(wc--c <"$file.br")

যদি [ "$origfs" -লে "$gzfs" ];
then
rm $file.gz -f
fi
if [ "$origfs" -লে "$brfs" ];
then
rm $file.br -f
fi

done

Leave a Reply