WP Super Cache and mod_pagespeed

So I finally got a chance to try mod_pagespeed on this server. I particularly wanted to know if it behaved well with WP Super Cache as I’d read reports that it causes problems.

Unfortunately those problems are real but I’ve been told that a new release will be out shortly to address a few bugs so perhaps this will help.

If you’d like to try mod_pagespeed make sure you disable compression in WP Super Cache and clear the cache first. Even though the docs state that the module always generates uncompressed HTML it appears to do the opposite. In fact, it tries to load mod_deflate:

# more pagespeed.load
LoadModule pagespeed_module /usr/lib/apache2/modules/mod_pagespeed.so

# Only attempt to load mod_deflate if it hasn’t been loaded already.
<IfModule !mod_deflate.c>
LoadModule deflate_module /usr/lib/apache2/modules/mod_deflate.so
</IfModule>

When things were working, supercached files were processed by mod_pagespeed correctly, I noticed inline Javascript was modified to remove whitespace and I presume other changes were made too but I already minify things and have static files off on another domain so perhaps the changes made on my pages are less minimal.

The changes made by mod_pagespeed, like minifying inline Javascript, are not cached by WP Super Cache so your server has to make these changes each time a page is served. I know that mod_deflate does not cache the gzipped page content, but zips up the page each time it’s served. Mod_pagespeed does however provide a caching mechanism so there’s a good chance those changes are cached there. I haven’t looked at the code so I don’t know.

I did have problems with dynamic pages. A simple phpinfo() refused to load quite often, and backend requests sometimes became stuck. Load on the server sky rocketed occasionally, usually when the module cache directory was emptied.

For now I’ve turned mod_pagespeed off but that might change as this is a young project and maturing fast! I’ll update this post whenever this happens.

More plugins releases soon

WP Super Cache, Domain Mapping and Sitewide Tags are all getting quite some attention.

Ron and I have been busy with Domain Mapping and Sitewide Tags.
A new version of Domain Mapping was released a few days ago with a couple of bug fixes and also a new feature that allows you to ignore the “primary domain” on your blogs. It has the potential for duplicate content if a blog can be found at multiple domains but some people need this feature. With careful organisation of content this can be avoided.

Sitewide Tags is almost ready for a new release. Ron added thumbnail support last week, and I checked in code last weekend to fill in the tags page with posts made before the plugin was installed. It needs testing, and if you’re any good at PHP please take a look at the development version on the download page.

WP Super Cache has had a number of bugs squished, preloading works better – it cancels immediately when you click that Cancel button. It also prints the url of the current post being preloaded which is handy if you’re not sure it’s working or not.
I added some extra debugging to make sure the homepage is cached correctly, but you have to enable “extra paranoid checks”. It works fine on my sites but I would really appreciate feedback if you have WordPress installed in a directory, installed in a directory different to where the site is or whatever configuration you might have. If it doesn’t work, the only side effect is that the homepage won’t be cached so it’s easy to spot when there are problems. I want these checks to be active all the time when the new version is finally released so it’s important this works correctly. Grab the development version from the download page and give it a whirl!

Don’t worry about upgrading when the next versions of Super Cache and Sitewide Tags are released. The version number in the development version is the same as the current release so a new version notice will still appear on your dashboard.

I almost forgot. Cookies for Comments has been worked on too! I added code that keeps an eye on how long a visitor reads a post before they post a comment. If the comment is made faster than a certain time the comment is automatically caught. I’ve used it over the weekend here and elsewhere and it’s catching a good number of “real looking” but spammy comments! The development version on the download page is what you’re looking for if you want to try this.

I think I need a P2 blog to post these sort of updates. Blog titles are such a pain sometimes.

Get Angry Birds for free on Android!

The good people at GetJar.com are now offering Angry Birds as a free download for mobile phones running Android.

The game is ad supported but as far as I can see, adverts appear at the start of the level and don’t appear on each one so they’re not intrusive. Works flawlessly on my Samsung Galaxy S too. Great job!

Oh, you might have to wait a while before downloading. The GetJar website is currently down, but persevere and you’ll get it!

This advert disappeared after a few seconds.

My phone is faster than yours

If you’re using a Samsung Galaxy S or one of it’s variants then my phone may well be twice as fast or even faster than your phone! How? It’s all rather simple actually.

First of all, I downloaded Quadrant Standard from the Android market. This is a benchmarking app that you can use to find out how fast your phone is. Run a benchmark and note the performance figure for your phone. Now, go look for “One Click Lag Fix” in the market and install that too.


This little app will root your phone, and install a new ext2 partition on your phone. The default Galaxy S filesystem isn’t that hot at running apps. The new partition will be used to store cache data, and because ext2 is supposedly better at caching your apps will load faster, and you’ll experience less or no lag when opening them. That was my experience with it anyway. This will help your phone’s performance significantly.

In recent updates to OCLF two new options were added, “Alter Minfree”, and “Change Scheduler”. Adjusting these will make a huge difference to your phone. Each one is explained briefly, with a recommended setting. I followed that advice and it’s like my phone is on steroids now! Apps open faster than ever and I’m just waiting for it to dance a jig it’s so fast and responsive.

Please be aware that running OCLF means rooting your phone and invalidating your warranty. You may brick your phone. That means it won’t work any more and can’t be fixed. It more than likely won’t happen and I haven’t read about it happening but you should be aware of the risks involved.

Bonus tip: If you’re running Linux on your desktop computer, the scheduler can be changed on that too. Must give that a go some time.

The worst targeted spam ever!

I honestly thought that spammers had gotten smarter about making sure their emails were taken seriously. Even the most geeky and anti-marketing of developers will realise that big red and bold text, center justified, looks like something out of the last century. I hope for the sake of their business that they put more effort into their backup service.

This email, which I received twice in the last week is just a joke. I would have immediately marked it as spam and forgotten about it but it mentioned WordPress and obviously my email address is on their list of WordPress bloggers. I wonder if they read my blog?

At least they didn’t CC everyone like an Irish guy did a few years back.

If you want me to look at your new service, write me a nice friendly email, address me by name, email me from your own email address, talk to me about something you’ve gleaned from my blog or my twitter stream so I at least think you’re a friendly individual and I may even check out your site.

Sunset at Seaside

image

It’s a hard job, but someone has to do it…

Easy Setup for WP Super Cache

One of the things that has bugged me about the WP Super Cache settings page was how it was laid out. Well, the next version of the plugin will display a simplified settings page to new users. If you’re upgrading, you’ll get the same old page as ever, don’t worry.

This version also adds a new method of serving cache files. It uses PHP, but serves supercache files. So, it’s a halfway house between using mod_rewrite (difficult to install for some users), and the legacy caching of WP Cache. That caching will be what is activated for users who use the simplified settings page.

There are lots of other bug fixes. The cache tester works if WordPress is installed in a sub directory, the admin page is separated out into tabs now to make it easier to find things. Error messages show up as “update messages” at the top of the browser now, making it easier for new users to figure out when mod_rewrite rules need updating and when other house keeping tasks need doing.

The code is red hot, liable to bend and break and may cause problems but it works fine here and on a test multi site install but I need testers to hammer on it and do things I don’t expect. If you’re brave, grab the development version off the download page. Thanks!

Android Battery Saving Tips

Battery usage on all so called “smart phones” is almost universally woeful. Big high-res colour screens, fast processors, sound, wifi and 3g networking all consume gobs of battery power.

Here are some battery saving tips for Android phones. I’m going on a long flight in a few days time so I’ll be trying these tips out before I go!

  • Go into Settings->About phone->”Battery use” to see what’s chewing up your battery.
  • Turn off haptic feedback. That’s vibration alerts when you press your screen. Turn off vibration as a notification too.
  • Apparently 3G uses more power than wifi so make sure wifi is always on. (Settings->Wireless and network->Wifi Settings->Advanced->Wifi sleep policy and select “Never”). My Galaxy S switches to 3G when the screen blanks by default but apparently this is a big battery saver. Only when you have a wifi network around I guess.
  • Always press “BACK” when you want to exit an app.
  • Turn off GPS. If your phone uses the cell network to find your location turn that off too.
  • Turn on power saving, and reduce the screen timeout so it goes black faster.
  • Turn off wifi when you leave your house or work. That stops your phone trying to connect to a network.
  • Turn off bluetooth when you don’t need it.
  • Turn off 3G and use 2G. (Ugh, slow!)
  • Turn off background data and syncing.
  • Turn down the brightness on your display.
  • Don’t use your camera.
  • Don’t use a live wallpaper, what’s wrong with a static picture?
  • Don’t use a homescreen widget that pulls data and updates all the time.
  • Task manager are generally frowned upon but some apps misbehave and don’t close properly. “Watchdog Lite” is a useful app that tells you how much CPU each app running on your phone consumes. Beware closing apps too much. They may look like they’re running, but they’re not. Android keeps them in memory, so they start up quickly next time.
  • Get Juice Defender off the Market. Besides a ton of battery saving features, the like of which I’m still trying to understand, it has a handy widget that will disable mobile data completely. Nice!

I’d love if Android phones totally disconnected from the Internet when I closed the browser, Tweetdeck or whatever app was using the network. My old Nokia 5800 did that. It connected each time I opened the browser and had wonderful battery life.

So, what other tips can you suggest for power hungry smartphones?

Update! With wifi and the 3G radio on the other night 6% of battery was used over about 6 hours. I switched off wifi and 3G (using Juice Extender) and the phone only burned through 2% of battery power over the same period last night.

Tweet Tweet dives into the past

I overhauled my Tweet Tweet plugin for WordPress yesterday so it would work with the new Twitter OAuth mechanism. This morning I made it possible to download your older tweets, up to the max limit of 3,200 tweets that Twitter allows.

It’s still a work in progress but I want to get a new release out as soon as I can for current users who are using the basic auth that doesn’t work any more. If you’re feeling adventurous give the development version on the download page a go and tell me what you think!

99% of the OAuth code was ripped from Alex King’s Twitter Tools which in turn uses Abraham Williams’ twitteroauth.php library and OAuth.php from oauth.net. Thank you all for doing the heavy lifting required!

WIP: the Super Cache admin page

A small update, I’m slowly working through the WP Super Cache admin page in an effort to make it better. You can in fact download the development version if you want to follow along.

What you see above is my first pass. An effort to make the first options section match the look and feel of the standard Settings pages in WordPress. It’s all likely to be mixed around and moved about before the next release, so please, dig in and lend a hand!