CSS Miniifier
Ndi CSS minifier, mutha kuchepetsa mafayilo amtundu wa CSS. Ndi CSS kompresa, mutha kufulumizitsa masamba anu mosavuta.
Kodi CSS minifier ndi chiyani?
CSS minifier ikufuna kuchepetsa mafayilo a CSS pamasamba. Lingaliro ili, lomwe limagwiritsidwa ntchito ngati chofanana ndi Chingerezi (CSS Minifier), limaphatikizapo makonzedwe a mafayilo a CSS. Ma CSS akakonzedwa, cholinga chachikulu ndikuwongolera mawebusayiti kapena ma coders kuti asanthule mizere molondola. Chifukwa chake, imakhala ndi mizere yambiri. Pali mizere ya ndemanga yosafunikira ndi mipata pakati pa mizere iyi. Ichi ndichifukwa chake mafayilo a CSS amakhala otalika kwambiri. Mavuto onsewa amathetsedwa ndi CSS minifier.
Kodi CSS minifier imachita chiyani?
Pamodzi ndi zosintha zomwe zidapangidwa mu mafayilo a CSS; miyeso imachepetsedwa, mizere yosafunikira imachotsedwa, mizere ya ndemanga zosafunikira ndi mipata imachotsedwa. Komanso, ngati ma code angapo akuphatikizidwa mu CSS, zizindikirozi zimachotsedwanso.
Pali ma plug-ins osiyanasiyana ndi ntchito za izi zomwe ogwiritsa ntchito ambiri amatha kuchita pamanja. Makamaka kwa anthu omwe amagwiritsa ntchito WordPress system, njirazi zimatha kukhala ndi mapulagini. Choncho, kuthekera kopanga zolakwika kumachotsedwa ndipo zotsatira zogwira mtima zimapezeka.
Anthu omwe sagwiritsa ntchito WordPress pa CSS kapena safuna kusankha mapulagini omwe alipo angagwiritsenso ntchito zida zapaintaneti. Potsitsa CSS ku zida zapaintaneti pa intaneti, mafayilo omwe alipo mu CSS amachepetsedwa posintha. Njira zonse zikatha, zidzakhala zokwanira kutsitsa mafayilo a CSS omwe alipo ndikuwayika patsamba. Chifukwa chake, ntchito monga CSS Minify kapena kuchepa zidzatha bwino, ndipo mavuto onse omwe angakhalepo kudzera mu CSS ya tsambalo adzathetsedwa.
Chifukwa chiyani muyenera kuchepetsa mafayilo anu a CSS?
Kukhala ndi tsamba lofulumira sikumangopangitsa Google kukhala yosangalala, kumathandizira kuti tsamba lanu likhale lokwera pamasakidwe komanso kumapereka mwayi wogwiritsa ntchito kwa omwe akuchezera tsamba lanu.
Kumbukirani, 40% ya anthu samadikirira ngakhale masekondi atatu kuti tsamba lanu lofikira likhazikitsidwe, ndipo Google imalimbikitsa kuti masamba azitsegula mkati mwa masekondi 2-3 nthawi zambiri.
Kuponderezana ndi chida cha CSS minifier kuli ndi ubwino wambiri;
- Mafayilo ang'onoang'ono amatanthauza kuti kukula kwatsamba lanu lonse kumachepetsedwa.
- Alendo amatsegula ndikupeza masamba anu mwachangu.
- Obwera patsamba amapeza zomwe ogwiritsa ntchito amakumana nazo popanda kutsitsa mafayilo akulu.
- Eni ake amasamba amapeza ndalama zotsika za bandwidth chifukwa data yochepera imatumizidwa pa netiweki.
Kodi CSS minifier imagwira ntchito bwanji?
Ndibwino kusunga mafayilo atsamba lanu musanawachepetse. Mutha kuchitapo kanthu pang'ono ndikuchepetsa mafayilo anu patsamba loyeserera. Mwanjira iyi mumawonetsetsa kuti zonse zikuyenda bwino musanasinthe tsamba lanu.
Ndikofunikiranso kufananiza liwiro la tsamba lanu musanayambe komanso mutachepetsa mafayilo anu kuti muthe kufananiza zotsatira ndikuwona ngati kuchepa kwakhala ndi zotsatirapo.
Mutha kusanthula kuthamanga kwa tsamba lanu pogwiritsa ntchito GTmetrix, Google PageSpeed Insights, ndi YSlow, chida choyezera gwero lotseguka.
Tsopano tiyeni tiwone momwe tingachitire kuchepetsa;
1. Manual CSS minifier
Kuchepetsa mafayilo pamanja kumatenga nthawi yambiri komanso khama. Ndiye kodi muli ndi nthawi yochotsa malo, mizere ndi ma code osafunikira pamafayilo? Mwina ayi. Kupatula nthawi, njira yochepetserayi imaperekanso malo ochulukirapo a zolakwika zaumunthu. Chifukwa chake, njira iyi siyikulimbikitsidwa kuti muchepetse mafayilo. Mwamwayi, pali zida zambiri zaulere zaulere zapaintaneti zomwe zimakulolani kukopera ndi kumata ma code kuchokera patsamba lanu.
CSS minifier ndi chida chaulere pa intaneti chochepetsera CSS. Mukakopera ndikumata kachidindo palemba la "Input CSS", chidachi chimachepetsa CSS. Pali zosankha zotsitsa zotulutsa za minified ngati fayilo. Kwa opanga, chida ichi chimaperekanso API.
JSCompress , JSCompress ndi kompresa ya pa intaneti ya JavaScript yomwe imakupatsani mwayi wopanikiza ndi kuchepetsa mafayilo anu a JS mpaka 80% ya kukula kwake koyambirira. Koperani ndi kumata khodi yanu kapena kwezani ndikuphatikiza mafayilo angapo kuti mugwiritse ntchito. Kenako dinani "Compress JavaScript - Compress JavaScript".
2. CSS minifier yokhala ndi mapulagini a PHP
Pali mapulagini ena abwino, onse aulere komanso amtengo wapatali, omwe amatha kuchepetsa mafayilo anu popanda kuchita masitepe amanja.
- Gwirizanitsani,
- chepetsa,
- tsitsimutsani,
- Mapulagini a WordPress.
Pulogalamu yowonjezera iyi imachita zambiri kuposa kungochepetsa nambala yanu. Imaphatikiza mafayilo anu a CSS ndi JavaScript kenako ndikuchepetsa mafayilo opangidwa pogwiritsa ntchito Minify (ya CSS) ndi Google Closure (ya JavaScript). Kuwongolera kumachitika kudzera pa WP-Cron kuti zisakhudze liwiro la tsamba lanu. Zomwe zili m'mafayilo anu a CSS kapena JS zikasintha, zimasinthidwanso kuti musachotse cache yanu.
JCH Optimize ili ndi zinthu zina zabwino kwambiri za pulogalamu yowonjezera yaulere: imaphatikiza ndikuchepetsa CSS ndi JavaScript, imachepetsa HTML, imapereka kuponderezedwa kwa GZip kuphatikizira mafayilo, ndi sprite kumasulira kwa zithunzi zakumbuyo.
CSS Minify , Muyenera kukhazikitsa ndi kuyambitsa kuti muchepetse CSS yanu ndi CSS Minify. Pitani ku Zikhazikiko> CSS Minify ndikuthandizira njira imodzi yokha: Konzani ndi kuchepetsa kachidindo ka CSS.
Fast Velocity Minify Ndi kuyika kopitilira 20,000 komanso nyenyezi zisanu, Fast Velocity Minify ndi imodzi mwazosankha zodziwika bwino pakuchepetsa mafayilo. Kuti mugwiritse ntchito, muyenera kungoyika ndikuyambitsa.
Pitani ku Zikhazikiko> Fast Velocity Minify. Apa mupeza njira zingapo zosinthira plugin, kuphatikiza zotsalira za JavaScript ndi CSS kwa opanga, zosankha za CDN, ndi chidziwitso cha seva. Zokonda zokhazikika zimagwira ntchito bwino pamawebusayiti ambiri.
Pulagiyi imachita kuchepera pa frontend mu nthawi yeniyeni ndipo pokhapokha pempho loyamba losasungidwa. Pempho loyamba litakonzedwa, fayilo ya cache yomweyi imatumizidwa kumasamba ena omwe amafunikira CSS ndi JavaScript.
3. CSS minifier yokhala ndi mapulagini a WordPress
CSS minifier ndi mawonekedwe omwe mumapeza nthawi zambiri mumapulagini osungira.
- WP Rocket,
- W3 Total Cache,
- WP SuperCache,
- WP Cache Yachangu Kwambiri.
Tikukhulupirira kuti mayankho omwe tapereka pamwambapa akuwunikirani momwe mungapangire CSS minifier ndipo mutha kumvetsetsa momwe mungagwiritsire ntchito patsamba lanu. Ngati mudachitapo izi m'mbuyomu, ndi njira zina ziti zomwe mudagwiritsa ntchito kuti tsamba lanu likhale lofulumira? Tilembereni m'gawo la ndemanga pa Softmedal, musaiwale kugawana zomwe mwakumana nazo komanso malingaliro anu kuti musinthe zomwe tili nazo.