حالت نے حال ہی میں بہت سے نئے مضامین نہیں لکھا ہے کہ میں اپ ڈیٹ کرنے اور چیزوں کے پیچھے مناظر جانب نظر ثانی کافی وقت گزارا ہے, یعنی مختلف سیکورٹی (TLS) settings on my VPS that hosts several sites including this one. Another thing I have also worked to enhance recently is to improve my use of gzip, اور ایک نئی شکل brotli بلایا
مختصر طور پر, GZIP (اور brotli) وہ براؤزر کو بھیجے جاتے ہیں اس سے پہلے وسائل سکیڑیں کرنے کے لئے استعمال کیا جا سکتا, جس کے اعداد و شمار کی رقم بھیجی کم کر دیتا ہے, and hence should mean a site loads faster. The downside is that compressing resources takes time, which could outweigh the gains from the smaller sizes. The ideal solution is to have resources compressed in advance, rather than compressed by the http server in realtime. Most of my websites use wordpress which contains lots of files in plugins, موضوعات وغیرہ, so going through all of these and manually compressing them everytime there is an update would be impractical. The answer is to use a script which monitors the system for file changes, and creates compressed files as needed. Below is the script I have recently written to do exactly this.
#!/bin/bash inotifywait -m -q -e CREATE -e MODIFY -e MOVED_TO -r "/متغیر / دیکھیے ورلڈ وائڈ ویب /" --شکل "%ڈبلیو٪ چ" --excludei '.(JPG|PNG|GIF|ICO|لاگ ان کریں|SQL|زپ|GZ|پی ڈی ایف|پی ایچ پی|SWF|TTF|EOT|woff کی|CST|JST|BR|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
ذیل میں تبصرہ کی طرف سے ہمیں اپنے خیالات بھیجیں کریں! آپ کے سبسکرائب کرنا چاہتے ہیں تو سب سے اوپر دائیں مینو پر لنک سبسکرائب استعمال کریں. آپ بھی ذیل سماجی روابط کا استعمال کرتے ہوئے کی طرف سے اپنے دوستوں کے ساتھ اس کا اشتراک کر سکتے ہیں. چیرس.
جواب چھوڑیں