Jump to content

Archived

This topic is now archived and is closed to further replies.

mckdesign

WPEngine caching and browser-specific CSS

Recommended Posts

mckdesign

Whatever browser hits my site first locks in place the body class. Not all that unexpected with caching.

 

Any workaround on this? Seems like it needs to be a client-side JS solution, but one that exactly mimics what DMS2 does to add the classes.

 

DMS2 on WP3.8.1

http://uspharmamktg.wpengine.com/

Share this post


Link to post
Share on other sites
Simon

well the pro plugin adds the browser classes using PHP, but you are caching before PHP is executed.

 

You could do a similar thing with jquery.. detect the browser type and insert the class into the body tag. No reason why not.

Share this post


Link to post
Share on other sites
mckdesign

Thanks, Simon. Any idea if that PHP can be executed post-cache? WPEngine is asking me if there's anything they could exclude that way.

 

Otherwise, I'll have to figure out a JS method. My pref is to keep DMS as stock as possible.

Share this post


Link to post
Share on other sites
Simon

Not sure what they have told you.

 

The whole point of a page cache is this..

 

Person A loads the page..
Nothing in cache..

Webserver loads PHP
PHP outputs page

Webserver returns it to the user the page output is saved into a cache store, varnish for WPE i think

Person B loads the page

Page found in cache
Cached page returned to user.

 

As you can see, thats why caching is faster, all the overhead of PHP is never loaded.

 

The pro tools will soon have a javascript version of the browser classes, but it wont be as feature rich as the php version.

Share this post


Link to post
Share on other sites
mckdesign

yup, totally get caching, just figured I'd ask, since PageLines recommends heavy caching (be it the host of a plug-in) and so maybe has a workaround.

 

I'll keep an eye peeled for the Pro Tools update, then.

Share this post


Link to post
Share on other sites

  • Similar Content

    • Lisa Haran
      By Lisa Haran+
      Hi 
      I have a map here http://www.iloveoffset.com/maps/
      I want to add several pointer locations to the map, but when I do they do not appear.
      On this map there are 2 pointer locations and as you can there is only one visible.
      Earlier today I added 7 and could only see 4 so there is something odd going on.
      My theme is up to date
    • clj182
      By clj182+
      Hello,
      I've been having trouble unlocking the template section for past couple of weeks. When I try clicking nothing happens. 
      I've deleted my custom css and removed plugins. Im down to having only the following plugins:
      Akismet
      Contact Form 7
      DMS Professional Tools
      Pagelines Updater
      WooCommerce
      It was working fine before i have no idea what's going on with it.
    • flourishdesignstudio
      By flourishdesignstudio+
      My DMS 2 site http://www.heart-stone.com/ will not save any new custom css... I can still edit templates and publish those but any custom css that I enter never saves.
      All WP files, themes, and plugins are up to date. 
      Any thought about what might be causing this?
    • flourishdesignstudio
      By flourishdesignstudio+
      Is there a way to edit the custom CSS via FTP? I know I can edit the custom code in the Chrome editor but is there a file path I can use to find and edit the CSS directly from our FTP?
      Thanks in advance for the help!
    • nizami
      By nizami+
      Using navbar section with correctly configured WP menu to display main navigation at https://elenaangel.com. 
      All fine in desktop viewport. Menu displays twice in hamburger mode. How to fix this please? 

×