1 / 5

2 Easy Ways To Solve “Add Expire Headers” in WordPress Website

"Learn two simple and effective ways to solve the 'Add Expire Headers' issue on your WordPress website. This guide will help improve your site's performance, boost loading speed, and enhance SEO by properly configuring cache expiration. Whether you're a beginner or an advanced user, these easy fixes will help you optimize your site in no time!

James1091
Download Presentation

2 Easy Ways To Solve “Add Expire Headers” in WordPress Website

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 2EasyWaysToSolve“AddExpireHeaders”inWordPressWebsite Mostpeopledon’tunderstandwhatare“ExpireHeaders”andhowtheyhelpinwebsitespeed.OtherpeoplearenotabletoaddthisfeatureinWordPress. Let’strytomakeiteasytounderstandforanyoneandeveryone. Weneedtounderstandabitabouthowbrowsershelptoimproveuserexperienceon awebsite. AllbrowserapplicationsuseacachetostorecertainmediaorresourcessuchasCSS files. Thiscachingaction,decreasespageloadingtime,translatingintoadelightfuluser experience. Animportantthingtonoteisthatthesefilesareonesthatarenotchangedfrequently.A webbrowserwillstorethesefilesinthecache.Whenthepageisrequestedagain,the fileswillbeloadedthroughthebrowsercacheinsteadofthe webserver. Abrowser’s cachecannotholdontoawebsite’sfileslikeimages,CSS,Javascript, etc.) forever.Thesefilesneedtobediscardedfromthecacheaftersometime.Thenfreshdata isrequestedfromthe webserver.

  2. ThisisWHERE“ExpireHeaders”willhelpyoumakeafasterloadingweb page. Gotitso far? Let’sgetintoabitmoredetailanddiscoverHOWthemagichappens. It’squitesimple.Allisyou needtodo,istosetthecorrectrulesinaparticularfile stored onthewebserver.Theserulessetthedatetodiscardoldcopiesandgetfreshcopies fromthe webserver. HOWWILLBROWSERCACHEEFFECT LOADSPEEDOFAWEBSITE? Whenauserclicksonalinkinthebrowser,anHTTPrequestgoestothewebserver browsertoallowfiledownload.Thebrowserthenstoresthefilesinthecachefora specifiedperiod. Thebrowserwill servethefilesimmediatelyinsteadofrequestingthewebserver. Letustakealookatanexamplethatwillhelpyouunderstandhowbrowser cachingcan beleveragedforbetterpagespeed. GTMetrixisaspecializedwebsiteperformanceanalysistool.Thebestdigitalmarketingcompaniesuseittotrackwebsitemetrics.AtypicalreportfromawebsiteanalysisperformedonGTMetrixwouldlooklike this Onthescreenshotyousee,thethirdrecommendationis“Leveragebrowsercaching”. Digitalmarketingexpertsknowthatthisrequirestheadditionof“ExpireHeaders”. HOWTOADDEXPIREHEADERS? TherearetwowaysinwhichExpiresHeaderscanbeaddedtoleverageabrowser’s caching ability. WecanchoosetoaddExpiresHeadersmanuallyorbyusinganappropriateplugin.Let’s findout howto do thisusingbothmethods. HOWTOADDEXPIREHEADERS?

  3. ThesolutionpresentedherewillshowyouhowtoaddExpireHeadersonApacheand NGINXserversin4 easy steps. STEP1– LogintoC-Panelonyourhostingaccount. STEP2 –LocatetheFileManagericonashighlightedbelow.Clickonit. AfterclickingontheFileManagericonyoushouldbeinthefilesandfolderstructureof yourwebsite. STEP3 –Nowlocatethefolder“public_html”(highlightedbytheredbox&arrow)witha blueglobeicon onits side.Goaheadand clickonthat. STEP 4–Thepublic_htmlfolderstoresthe“.htaccess”file.Navigateyourpointertothe “.htaccess”fileandRIGHTCLICKonit.Whenyouarepresentedwithamenu,choose EDIT. Nowcomestheeasiest part. Justcopyandpastethelinesofcodedisplayed below. <IfModulemod_expires.c> ExpiresActiveOn # Images ExpiresByTypeimage/jpeg“accessplus1 year” ExpiresByTypeimage/gif“accessplus1year” ExpiresByTypeimage/png“accessplus1year” ExpiresByTypeimage/webp“accessplus1year” ExpiresByTypeimage/svg+xml“accessplus1year” ExpiresByType image/x-icon “accessplus 1year” # Video ExpiresByTypevideo/mp4“accessplus1 year”

  4. ExpiresByTypevideo/mpeg“accessplus1 year” #CSS,JavaScript ExpiresByTypetext/css“accessplus1month” ExpiresByType text/javascript“access plus1month” ExpiresByTypeapplication/javascript“accessplus1month” # Others ExpiresByTypeapplication/pdf“accessplus1month” ExpiresByTypeapplication/x-shockwave-flash “accessplus1month” </IfModule> ADDINGEXPIREHEADERSINWORDPRESSBYUSING PLUGIN IfyouarenotcomfortablewitheditinganyfilesthenAddingExpireHeadersfrom .htaccessisnotbeadvisable.Anytypeofmistakeineditingcanrenderthewebsiteinaccessible. Luckilypluginsareavailable forWordPressusersto solvethisissue.Someofthehighly recommendedpluginsare: ADDEXPIREHEADERSPLUGIN Itwill: Reducepageloadtimebycaching browser Improveuserexperience Decreasethetotaldatasizeofthepage Ithasbothfreeandprofeatures. W3TOTALCACHE

  5. WhenitcomestobrowsercachingW3TOTALCACHEpluginisanexcellentplugin available.Itsolvesmanywebpagecacheproblems.Italsooffersfilecompressionaswell aswebsitesecurity,andtraffic management. Itdoesalotmoreincludingallowingauser tominifyJavaScript,andthebestthingofallisthatitisafreeplugin.Let’shopeitstays thatway! WPROCKET WPRocketisalsoagreatplugin.Thatisifwouldliketogowithapremiumandcanafford it. Startingat49$peryearitoffersalot.Fromcachingandgziptocompression,lazyloading expiresheadersandawholelotmore.Youdon’tneedtoaccessanyfilesoradd, delete oreditasinglelineofcode.Thispluginwilldoeverythingfor youandkeepyourwebsiteintip-topshape. That’sit! Bookmarkthispageandcomebacktoitifyouneedarefresher.

More Related