I-minifier Ye-CSS

Nge-CSS minifier, ungakwazi ukunciphisa amafayela esitayela se-CSS. Nge-CSS compressor, ungakwazi kalula ukusheshisa amawebhusayithi akho.

Yini i-CSS minifier?

I-CSS minifier ihlose ukunciphisa amafayela e-CSS kumawebhusayithi. Lo mqondo, osetshenziswa njengesilingana nesiNgisi (CSS Minifier), uhlanganisa ukuhlelwa kumafayela e-CSS. Uma ama-CSS elungiswa, umgomo omkhulu uwukuba abalawuli besizindalwazi noma amakhodi bahlaziye imigqa ngendlela efanele. Ngakho-ke, iqukethe imigqa eminingi. Kunemigqa yokuphawula engadingekile nezikhala phakathi kwale migqa. Yingakho amafayela e-CSS eba made kakhulu. Zonke lezi zinkinga ziqedwa nge-CSS minifier.

Yenzani i-CSS minifier?

Kanye nezinguquko ezenziwe kumafayela e-CSS; ubukhulu buncishisiwe, imigqa engadingekile iyasuswa, imigqa yokuphawula engadingekile nezikhala ziyasuswa. Ngaphezu kwalokho, uma ikhodi engaphezu kweyodwa ifakiwe ku-CSS, lawa makhodi nawo ayasuswa.

Kunama-plug-in ahlukahlukene kanye nezinhlelo zokusebenza zale misebenzi abasebenzisi abaningi abangazenza mathupha. Ikakhulukazi kubantu abasebenzisa uhlelo lwe-WordPress, lezi zinqubo zingenziwa ngokuzenzakalelayo ngama-plugin. Ngakho-ke, amathuba okwenza amaphutha ayaqedwa futhi kutholwe imiphumela ephumelelayo.

Abantu abangasebenzisi i-WordPress ku-CSS noma abangafuni ukukhetha ama-plugin akhona bangasebenzisa namathuluzi aku-inthanethi. Ngokulanda i-CSS kumathuluzi aku-inthanethi nge-inthanethi, amafayela akhona ku-CSS ancishiswa ngokwenza izinguquko. Ngemuva kokuthi zonke izinqubo seziqediwe, kuzokwanela ukulanda amafayela akhona e-CSS futhi uwalayishe kuwebhusayithi. Ngakho, imisebenzi efana ne-CSS Minify noma ukuncipha izoqedwa ngempumelelo, futhi zonke izinkinga ezingase zibe khona nge-CSS yesayithi zizoqedwa.

Kungani kufanele unciphise amafayela akho e-CSS?

Ukuba newebhusayithi esheshayo akugcini nje ngokujabulisa i-Google, kusiza iwebhusayithi yakho ukuba ibekwe phezulu ekuseshweni futhi ihlinzeka ngolwazi lomsebenzisi olungcono kubavakashi besayithi lakho.

Khumbula, u-40% wabantu awulindi ngisho imizuzwana emi-3 ukuthi ikhasi lakho eliyisiqalo lilayishwe, futhi i-Google incoma ukuthi amasayithi alayishwe phakathi kwamasekhondi angu-2-3 kakhulu.

Ukucindezela ngethuluzi le-CSS minifier kunezinzuzo eziningi;

  • Amafayela amancane asho ukuthi usayizi wokulanda wesayithi lakho unciphile.
  • Izivakashi zesayithi zingalayisha futhi zifinyelele amakhasi akho ngokushesha.
  • Izivakashi zesayithi zithola isipiliyoni somsebenzisi esifanayo ngaphandle kokulanda amafayela amakhulu.
  • Abanikazi besayithi bathola izindleko eziphansi zomkhawulokudonsa ngoba idatha encane idluliselwa ngenethiwekhi.

I-CSS minifier isebenza kanjani?

Kungumqondo omuhle ukwenza ikhophi yasenqolobaneni amafayela esayithi lakho ngaphambi kokuwashwabana. Ungakwazi ngisho nokuthatha isinyathelo esiqhubekayo futhi unciphise amafayela akho kusayithi lesilingo. Ngale ndlela uqinisekisa ukuthi yonke into ilungile futhi iyasebenza ngaphambi kokwenza izinguquko kusayithi lakho elibukhoma.

Kubalulekile futhi ukuqhathanisa isivinini sekhasi lakho ngaphambi nangemuva kokunciphisa amafayela akho ukuze ukwazi ukuqhathanisa imiphumela futhi ubone ukuthi ukuncipha kube nawo yini umphumela.

Ungakwazi ukuhlaziya ukusebenza kwesivinini sekhasi lakho usebenzisa i-GTmetrix, i-Google PageSpeed ​​​​Insights, kanye ne-YSlow, ithuluzi lokuhlola ukusebenza komthombo ovulekile.

Manje ake sibone indlela yokwenza inqubo yokunciphisa;

1. I-minifier ye-CSS ye-Manual

Ukuncipha kwamafayela mathupha kuthatha isikhathi esiningi nomzamo. Ngakho-ke ingabe unaso isikhathi sokususa izikhala ngazinye, imigqa nekhodi engadingekile kumafayela? Cishe cha. Ngaphandle kwesikhathi, le nqubo yokunciphisa iphinde inikeze indawo eyengeziwe yamaphutha omuntu. Ngakho-ke, le ndlela ayinconywa ukunciphisa amafayela. Ngenhlanhla, maningi amathuluzi e-minification aku-inthanethi wamahhala akuvumela ukuthi ukopishe futhi unamathisele amakhodi kusayithi lakho.

I- CSS minifier iyithuluzi eliku-inthanethi lamahhala lokunciphisa i-CSS. Uma ukopisha futhi unamathisela ikhodi endaweni yombhalo ethi “Input CSS”, ithuluzi lenza i-CSS ibe ncane. Kunezinketho zokulanda okukhiphayo okuncishisiwe njengefayela. Konjiniyela, leli thuluzi lihlinzeka nge-API.

I-JSCompress , i-JSCompress iyi-compressor ye-JavaScript eku-inthanethi ekuvumela ukuthi ucindezele futhi unciphise amafayela akho e-JS aze afike ku-80% wosayizi wawo wangempela. Kopisha futhi unamathisele ikhodi yakho noma ulayishe futhi uhlanganise amafayela amaningi ukuze uwasebenzise. Bese uchofoza "Cindezela i-JavaScript - Cindezela i-JavaScript".

2. I-CSS minifier enama-plugin we-PHP

Kunama-plugin amahle kakhulu, amahhala kanye ne-premium, anganciphisa amafayela akho ngaphandle kokwenza izinyathelo ezenziwa ngesandla.

  • Hlanganisa,
  • nciphisa,
  • vuselela,
  • Ama-plugins we-WordPress.

Le plugin yenza okungaphezu kokunciphisa ikhodi yakho. Ihlanganisa amafayela akho e-CSS ne-JavaScript bese yenza amafayela adalwe kusetshenziswa i-Minify (ye-CSS) ne-Google Closure (ye-JavaScript). Ukunciphisa kwenziwa nge-WP-Cron ukuze kungathinti isivinini sakho sesayithi. Uma okuqukethwe kwamafayela akho e-CSS noma e-JS kushintsha, anikezwa kabusha ukuze ungathululi inqolobane yakho.

I-JCH Optimize inezici ezinhle kakhulu ze-plugin yamahhala: ihlanganisa futhi yenza kube lula i-CSS ne-JavaScript, yenza i-HTML ibe lula, inikeza ukucindezelwa kwe-GZip ukuze kuhlanganiswe amafayela, kanye nokunikezwa kwe-sprite kwezithombe zangemuva.

I-CSS Minify , Udinga kuphela ukufaka futhi wenze kusebenze ukuze unciphise i-CSS yakho nge-CSS Minify. Iya kokuthi Izilungiselelo > I-CSS Minify futhi unike amandla inketho eyodwa kuphela: Lungiselela futhi unciphise ikhodi ye-CSS.

I-Fast Velocity Minify Ngokufaka okusebenzayo okungaphezu kuka-20,000 kanye nesilinganiso sezinkanyezi ezinhlanu, i-Fast Velocity Minify ingenye yezinketho ezidume kakhulu ezitholakalayo zokuncipha kwamafayela. Ukuze uyisebenzise, ​​udinga kuphela ukuyifaka nokuyenza isebenze.

Iya kokuthi Izilungiselelo > Isivinini Esisheshayo Miniify. Lapha uzothola izinketho eziningi zokumisa i-plugin, okuhlanganisa okungafakwanga kwe-JavaScript ethuthukisiwe ne-CSS konjiniyela, izinketho ze-CDN, nolwazi lweseva. Izilungiselelo ezizenzakalelayo zisebenza kahle kumasayithi amaningi.

I-plugin yenza ukuncipha endaweni engaphambili ngesikhathi sangempela futhi kuphela phakathi nesicelo sokuqala esingagciniwe. Ngemva kokuba isicelo sokuqala sesicutshunguliwe, ifayela elifanayo lenqolobane emile lihanjiswa kwamanye amakhasi adinga isethi efanayo ye-CSS ne-JavaScript.

3. I-CSS minifier enama-plugin e-WordPress

I-CSS minifier isici esijwayelekile ovame ukusithola kuma-plugin okulondoloza inqolobane.

  • WP Rocket,
  • Ingqikithi Yenqolobane ye-W3,
  • I-WP SuperCache,
  • I-WP Cache esheshayo.

Sithemba ukuthi izixazululo esizethule ngenhla zikukhanyisele ukuthi ungayenza kanjani i-CSS minifier futhi ungaqonda ukuthi ungayisebenzisa kanjani kuwebhusayithi yakho. Uma ukwenze lokhu ngaphambilini, yiziphi ezinye izindlela oye wazisebenzisa ukwenza iwebhusayithi yakho isheshe? Sibhalele esigabeni sokuphawula kuSoftmedal, ungakhohlwa ukwabelana ngolwazi lwakho neziphakamiso zokuthuthukisa okuqukethwe kwethu.