addressalign-toparrow-leftarrow-leftarrow-right-10x10arrow-rightbackbellblockcalendarcameraccwcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscontroller-playcredit-cardcrossdots-three-verticaleditemptyheartexporteye-with-lineeyefacebookfolderfullheartglobe--smallglobegmailgooglegroupshelp-with-circleimageimagesinstagramFill 1languagelaunch-new-window--smalllight-bulblinklocation-pinlockm-swarmSearchmailmediummessagesminusmobilemoremuplabelShape 3 + Rectangle 1ShapeoutlookpersonJoin Group on CardStartprice-ribbonprintShapeShapeShapeShapeImported LayersImported LayersImported Layersshieldstartickettrashtriangle-downtriangle-uptwitteruserwarningyahooyoutube

Introducing RequireWP!

From: jimbo2150
Sent on: Saturday, February 18, 2017 7:18 AM
Columbus WordPress Meeting Members,

This WordPress plugin is meant to speed up WordPress and is designed to work alongside encryption and HTTP/2.

Out-of-date recommendations will tell you to just concat all your scripts together into one big file and include that file on all your pages. However, with HTTP/2 being implemented in more and more places and encryption rapidly on the rise (now surpassing 50% of browser requests thanks to free certificates), that requirement is changing. As scripted applications become larger and more complex there is a need to conserve bandwidth and reduce repetition of utility scripts.

That is where RequireWP comes in. It extends the WP_Scripts class in WordPress to output your registered scripts using Require.js syntax. It is meant to encourage developers to write code that loads at better times in the browser workflow, loads asynchronously, and only when it is needed.

Got that great video plugin you developed but just loading the player but just loading it on all pages when only a fraction have the player embedded? Why not load it only when it is needed. Instead, add a DNS prefetch to the header to keep it alive then use Require.js to load it when it is required. Require.js allows you to do that and RequireWP allows you to do it through WordPress.

HTTP/2 allows for downloading many script and stylesheet files within the same TCP window, reducing overhead. Headers can also be compressed. However, most browsers require an encrypted connection to make use of HTTP/2 - so it is highly recommended you get one of the many free certificates offered today and start speeding up your site and reducing bandwidth.

Give it a try and let me know what you think of it or if you run into any issues!

https://techie-jim.net/programming/introducing-requirewp/

   - Jim Robinson

People in this
group are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy