Forum Moderators: rogerd & travelin cat

Message Too Old, No Replies

Caching Plugins and Mobile/Responsive Themes

W3 Total Cache and WP Super Cache - Cache Only for Desktop?

         

Webwork

9:01 pm on Jul 22, 2015 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



After a few quick searches and reading I'm left a bit uncertain about the capacity of caching plugins to work with mobile - responsive themes.

I'm left with the impression that the 2 most popular caching plugins - W3 Total Cache and WP Super Cache - only generate a single, desktop version of "cached page". It appears that the plugins reference mobile related plugins . . but those references don't appear to "solve the problem".

Am I wrong? Can either W3 or WPSC be configured to generate cached pages that will function and display properly - as cached pages - for popular framework / child themes such as Genesis or Thesis themes?

If not, what's the solution for speeding up mobile responsive site designs build using Wordpress and a mobile responsive theme?

Webwork

4:34 pm on Jul 23, 2015 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Getting closer to an understanding of this issue:

[support.appticles.com ]

[wordpress.org ]

Hmmmm . . . Looks like the settings in W3 Total Cache / Super Cache allow plugin users to "disable" caching for mobile user agents, so the cached version of pages is only served to desktop / laptop visitors.

I guess I'll have to play around a bit with the "advanced" settings on the caching pluginss AND approach this as doing as much as possible to speed up any Wordpress site by all other available means and use caching as the final booster stage/rocket.

That said, I'm still inviting insight and guidance. Google wants sites to be both Fast AND Responsive. Fast would appear to dictate caching. Responsive would appear to dictate . . not caching (unless you have a dozen(?) cached / static versions. Which leaves me a bit like the donkey facing the 2 piles of hay.

robzilla

5:45 pm on Jul 23, 2015 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The whole point of having a responsive layout is that you use a single layout for all devices, and it adapts to the viewport size. It's very different from a separate mobile site. What many WordPress themes and plugins are doing is serve different code to mobile users. This is a rather clumsy solution, and what you're running into now is just one of the obstacles it imposes. You wouldn't have this problem with a responsive layout.

I know W3 Total Cache allows you to not serve cached pages to mobile users, but again that's an imperfect solution, especially because mobile users already suffer from higher latency. While some caching is better than no caching at all, if the number of mobile users continues to grow then so will the load time and the strain on your server, and the benefits will diminish. In your situation, however, where you don't yet have a responsive site, it's the only solution since these caching plugins don't support multiple cached versions of a page.

Ideally, then, you would implement a responsive layout. That allows you to serve a single cached version of any page to all your users.

Webwork

7:13 pm on Jul 23, 2015 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Thanks, Rob.

I am working with responsive themes / frameworks: Thesis and Genesis.

If I understand your comment correctly then there will be no need to "opt out", via W3TC or WPSC advanced options, from serving a non-cached page to mobile browsers? In other words, the "cached page" will, as a result of the responsive theme, resize accordingly?

I guess I've had it stuck in my head that the cached page would be a page/file that was reduced to a ~static html page.

Perhaps as I play with this (I've yet to buy a tablet . . . argh) it will become clearer.

Webwork

7:27 pm on Jul 23, 2015 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Okay, so maybe I'm just a dummy . . umm . . lacking experience. I just downloaded WP Super Cache to a very preliminary test site that is running Thesis' "Classic Responive" child theme, activated the SC plugin, did NOT have to check any boxes about "not caching for mobile" and preloaded the site.

Resizing my desktop browser resulted in the cached pages resizing nicely.

Man . . I do detest how I can create problems for myself that aren't really present. Memo to self: Run a few tests - go ahead, risk it - before concluding that there will be problems. Of course, ^this^ type of thinking (run a test) is great when one has a proper test environment. Hopefully this test will validate when I complete the transformation of a much larger / complex site, with images, video boxes, etc. (Have no fear. I will back up first. Argh.)

robzilla

8:51 pm on Jul 23, 2015 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I guess I've had it stuck in my head that the cached page would be a page/file that was reduced to a ~static html page.

It is :-) The HTML that WordPress generates on demand is saved to a flat file or straight into memory and quickly fetched from there, circumventing (most of) the HTML compilation process (calculations, database queries, etc), on a subsequent request. With responsive design, however, that HTML page is not strictly "static" in the sense that its layout is fixed, because with CSS and media queries we can now have a web browser apply certain changes to the basic layout, based on the size of the user's viewport. The HTML doesn't change, nor does the CSS, but rules can be baked into both of them to alter the rendering of the page. The same page may look different on different devices and viewports, but everything is based on the same (cached) code, which is beautiful really.

I once messed around with WordPress page caching on the web server side and ended up with cached pages that showed my WordPress admin bar at the top of the page (to everyone) because I (the admin) had been the first to access the page, and so the HTML I saw was cached and shown to all subsequent visitors. Took me a while before I noticed it, too. Caching can be tricky business! If done right (and the caching plugins you mention are pretty good), however, it can mean the difference between a $100 and $5 server, and give the user experience a boost, to boot.