Using WP Customizer without impacting the page load speed..

live theme customizerThe latest feature of WordPress, WP Customizer is the latest buzz in WP dev. community. Finally, after some improvements most of the Premium theme authors have finally accepted the new feature with both hands. WP Theme customizer allows a user to make changes in the site appearance “Live”. By Live I mean that on one half of the screen you have the options and on the other half you have your site, so any changes you make in the theme options, appear instantaneously on the right part. With this feature I am glad that WordPress now focusses on usability part of the CMS, though I still wait for an editor like Aloha to be integrated in the WordPress as a core functionality.

However, WP Theme customizer comes with some redundancies which many theme developers like me don’t like. WordPress recommends that you can add the custom CSS generated from the Theme customizer directly into the html. This would mean that all the CSS generated would directly go into the HTML. I have found a lot of theme authors are doing this, below are few screenshots form a top selling theme on Themeforest:

live theme customizer

The Issue

The disadvantage of this method is that the CSS generated by this method can not be cached, neither by server nor by browser. So if a theme is using this functionality heavily, it will generate a lot of CSS which can not be cached. Therefore it will impact the page speed majorly. {refer to this reading..}

A Possible Solution

We also encountered this issue while creating VibeCom. A simple solution we’ve given is as follows:

  1. Enable WP Theme Customizer from a settings in Vibe Options Panel.
  2. Copy all the generated CSS from view source.
  3. Add a hook in your WP Theme after wp_head()
  4. Attach a custom CSS file to that hook.
  5. Paste the generated CSS code in the custom CSS file.
  6. Disable WP Theme customizer.

Though I am optimistic future updates in WP would  overcome this hurdle as well, but for the time being the above suggested solution works fine without impacting the Page load times of the site.

September 18, 2015

0 responses on "Using WP Customizer without impacting the page load speed.."

Leave a Reply

top
Template Design © VibeThemes. All rights reserved.

Privacy Preference Center

Necessary

This cookie is set when you login to your account at VibeThemes. VibeThemes based on WordPress sets this cookie, which indicates when you're logged in, and who you are, for most interface use.

WordPress uses the two cookies to bypass the password entry portion of wp-login.php. If WordPress recognizes that you have valid, non-expired cookies, you go directly to the WordPress Administration interface. If you don't have the cookies, or they're expired, or in some other way invalid (like you edited them manually for some reason), WordPress will require you to log in again, in order to obtain new cookies.

wordpress_logged_in_[hash],wp-settings-{time}-[UID]

Advertising

Analytics

Comments

When you comment on VibeThemes blog, they too get cookies stored on their computer. This is purely a convenience, so that the visitor won't need to re-type all their information again when they want to leave another comment.
The commenter cookies are set to expire a little under one year from the time they're set.

comment_author_{HASH},comment_author_email_{HASH},comment_author_url_{HASH},

%d bloggers like this: