Posted on

Sitemap Indexes now supported on MageSpeedTest.com

Long time, no post. Sorry about that. I’ve been very busy working on an app for aggregating ecommerce orders on your mobile device. Check out the sneak peek from twitter. I’m also looking for some private beta testers so if you’re keen to try it out and willing to give us some helpful feedback, flick me an email.

Anyway this is just a quick update on some features (arguably fixes) I added tonight for MageSpeedTest.com. The first is support for multiple sitemap files in a sitemap.xml index file. The second is support for gzipped sitemap files (but only if they are references in the sitemap index).

I have also implemented a couple of measures to prevent the number of links getting out of hand. Firstly for very large sitemaps once I have 10000 links for a single site, I stop collecting them. Secondly if a site does have over 10000 links, I cache them instead of fetching them on each and every speed test.

This caching has been implemented to preserve system resources, now that the servers are monitoring and testing hosts regularly there’s a decent amount going on and I don’t want the test performance to suffer due to downloading millions of URLs from sitemaps unnecessarily.

There are still some outstanding issues with MageSpeedTest.com – if you have emailed me about them be assured I will get to them!

Stay tuned for some posts on my experiences developing the mobile web app, using jQuery mobile and Google App engine.

Posted on

SMTP Pro with Magento: A sort-of user guide.

This blog post is about the SMTP Pro extension. It is my attempt at full explanations to some very good questions/feedback from Chris Last in his comment on an earlier post. I decided that I should give thorough explanations to the questions and they probably belong in a blog post rather than a reply comment. Hopefully it’ll form a mini user-guide, I’ll try to update it as such over time.

Update July 2013: I have since released a premium extension for sending email using Amazon SES called MageSend, if you’re having toruble sending email with Magento, please check it out, it was created to solve many common Magento email issues.

There are too many sections in Config->Advanced->System for me to make complete sense of:

Mail Sending Settings – do these have any effect?
Disable Email Communications No
Host localhost
Port (25) 25
Set Return-Path no

1) The Mail Sending Settings are the built in Magento ones, they don’t work very well for custom SMTP servers and you can safely ignore them. One thing to note though. I do adhere to their disable configuration in my extension. So if you disable all emails using the core config here, all emails do stop even if sending via SMTP Pro.
Continue reading SMTP Pro with Magento: A sort-of user guide.

Posted on

Magento and Amazon’s CloudFront CDN – The Easy Way

In this post I will cover a simple way to configure Magento to use the Amazon CloudFront CDN service and to create a CloudFront distrubution that mirrors the static files in your site. This method relies on the custom origin functionality announced late last year when CloudFront came out of beta. But first, a little background.

A CDN (content distribution network) is a network of servers that puts your files and content closer to the user requesting them, and thus they can get the quicker. Using a CDN has a nice side effect of offloading some work from your own server too – which if you use Apache means less processes on your server for each customer.

When Amazon first announced CloudFront I got very excited about the prospect of writing an extension to automatically sync a Magento store’s media with an S3 bucket, to enable this simple, affordable CDN solution. Alas, it turned out to be quite hairy dealing with the subtle race conditions that can occur when first accessing a specific media file that may not be available on the CDN yet.

With the introduction of custom origin functionality there is no situation where the CDN won’t have the file. If the CDN doesn’t have the file, it gets it from the underlying source server, if it already has it, it serves it. This means the first request for a file will be a bit slower, but after that it’ll be quick.

So to make a CloudFront distribution work in Magento it only takes two steps.
Continue reading Magento and Amazon’s CloudFront CDN – The Easy Way

Posted on

Cloud Backup Case study: Detecting if Magento cron is running in your extensions

We released the latest version of our Magento Cloud Backup extension, for sending a full site and database backup offsite to Amazon’s cloud storage service S3. You can read about the latest release over on the World Wide Access site. In this post I wanted to quickly cover the method I used for detecting if cron is running on a Magento store. This was one of the new features added to help new users identify possible problems.

I think it’s important for many extensions that rely on cron to check if it is running, because otherwise it’s possible for users to have a false sense of security (particularly around automated backups). This technique I mentioned briefly back in October at the Magento Developers Paradise. This more fully worked example will hopefully be useful to others.

The logic is this: If we have no pending jobs, or no successful jobs in the Magento cron table, then cron is probably not running (either it never has, or only has once).

$schedules_pending = Mage::getModel('cron/schedule')->getCollection()
        ->addFieldToFilter('status', Mage_Cron_Model_Schedule::STATUS_PENDING)
        ->load();
$schedules_complete = Mage::getModel('cron/schedule')->getCollection()
        ->addFieldToFilter('status', Mage_Cron_Model_Schedule::STATUS_SUCCESS)
        ->load();
 
 if (sizeof($schedules_pending) == 0 || 
        sizeof($schedules_complete) == 0) {
                // cron probbaly isn't running
}

With this code run from within a frontend model, or a controller, you can effectively inform your users that cron is probably not running. It would be quite a nice service actually that just automatically calls cron for Magento stores via the web.

It would also be possible to look at when the last successful job completed, if it was days ago then it may also be a clue that cron has been running, but has since stopped. If anyone has an alternative approach, please let me know I’d like to hear it.

Posted on

Magento, Google XML Sitemaps and my Magento Speed Test

My Magento performance testing tool Magento Speed Test uses a Google sitemap.xml to determine which urls should be tested. Having only just released the latest version I have been keeping an eye on the testing over the last few days and have noticed a few tests that never got results. This sometimes happens because of a mistake by me, but more often it’s because people find creative ways to muck up their sitemap.xml, and so the test then runs on no urls, and thus – no results. Here are some tips to check for problems.

After I sighed publicly about the various issues with sitemaps I was seeing a few internet friends asked for some more information, so here is a guide to a good sitemap.xml for performance testing Magento – I’ll do my best to keep updating this as I find more issues.
Continue reading Magento, Google XML Sitemaps and my Magento Speed Test