Digital Technique at RNZ, 2005-2016, Half 4 – Richard Hulse

Partially considered one of this sequence I coated the original strategy, and partially two the RFP and site, and partially three the design.
Partially 4 I’ll do a deep dive beneath the hood into our content material administration system (CMS) decisions. That is the longest half, which displays the significance of the selections we made on this space to assist the general technique.
The CMS
We selected MySource Matrix, offered by Squiz in Australia, as the inspiration for the location. On the time this was chosen it was utilized by a few massive radio networks in Australia, so it appeared like match. In 2005 it was an ‘open core’ platform, with an open supply model and a supported business model with additional options. We took up a assist possibility to permit us to fund customisations and have these commercially supported.
One in every of these was the addition of an audio asset to the CMS, and software program scripts to permit information and audio content material (metadata solely, the audio was saved elsewhere) to be imported.
The CMS was chosen as a result of its design allowed us so as to add performance to the location with out requiring a developer. The system was made up of modules that may very well be ‘wired up’ to offer pages, lists, varieties, embedded content material, and so forth. We definitely couldn’t have grown as quick as we did with out it.
We have been very lucky to have Colin Macdonald as our energy-drink powered sysadmin, and he utilized many tweaks to maintain the location secure as site visitors shortly grew. He developed some very sophisticated cache management that allowed us to shortly publish, clear any cached content material, after which refresh the cache once more. These within the know can pause and admire how arduous that’s, the remainder of you’ll be able to learn on…
Later, when Squiz opened an workplace in New Zealand, we had Murray Fox as our locally-based sysadmin, additionally a genius, and like Colin, utterly unflappable beneath stress.
Round 2007 the only server was beginning to battle with load and we upgraded to a number of, and bigger, servers. These in flip ran out of steam in late 2008, and by the tip of 2009 we have been struggling once more. The urged improve required over 100 cores of CPU, and this triggered a deeper philosophical evaluation into our long-term wants.
In a nutshell, we had outgrown the software program, each by way of our publishing wants, but in addition from a efficiency perspective. We’d heard that the opposite media purchasers in Australia had dropped the platform for related causes, and we additionally made the choice to interchange it.
A lot work went into evaluating options, together with business and open supply platforms. The business platforms—some utilized by different public broadcasters—have been very costly and all required customisation for every set up, basically turning into bespoke within the course of.
The open supply platforms have been able to media publishing, but in addition required a number of customisation that may have made upgrades advanced, and in the end we’d find yourself with a tough to take care of fork of the unique undertaking. I had seen this occur elsewhere, in a single case they’d used Drupal as the bottom, including bits and items on as wanted, and in the long run the codebase was crumbling beneath years of technical debt and was deserted.
The lesson from this was that in case you do construct on an open supply platform, it’s important to observe their conventions for including options and customisations, in any other case it should develop into arduous to get updates from the upstream supply, and you’ll find yourself with an orphaned undertaking that bears little resemblance to, and will get no profit from, the unique undertaking. And in that case, you may as properly have constructed one thing your self from scratch and never have the overhead of what’s inevitably a transforming of the present code.
You additionally received’t have the ability to contribute again to the undertaking, which certainly is the entire level of open supply.
An alternative choice to these have been frameworks reminiscent of Django, and Ruby on Rails. We had thought of Bricolage early on within the course of, and whereas the method of making static pages primarily based on recognized workflows was sound, the framework was not seeing a lot trade assist. Ultimately we picked Rails as a result of quite a few native firms have been capable of present providers, and it simply solved our efficiency and content material structuring issues, and had a strong future.
The opposite issue that tipped the scales in favour of Rails over (say) WordPress or Drupal, was that we solely constructed what we wanted, and we have been in full management, permitting for better optimisation of workflows and tooling.
For instance, in Rails we have been capable of have objects referred to as ‘station’, ‘programme’, ‘episode’, ‘presenter’, and ‘recipe’, to call a couple of. These objects had associations with one another within the CMS, reminiscent of a station has many programmes, a programme has many episodes, and so forth. That is rather more highly effective than the options we checked out that are actually simply constructed on structured pages; there isn’t any idea of a ‘programme’, and that is additionally one thing we struggled with in Matrix.
In June 2011 I wrote about a number of the issues we had structuring content material in Matrix.
The construction we created in Rails meant we by no means needed to work across the generic constructs of an current system. From a coding standpoint, our method was additionally a lot quicker, each by way of updating current code and bug fixes, and constructing new options.
There was additionally a efficiency side to this. In Rails the question to fetch the audio objects for an episode was extraordinarily quick as a result of each audio and episodes have been native objects with a pure database affiliation. In generic content material platforms these objects and relationships don’t exist, generally making it unattainable to get good efficiency.
I actually can not emphasise sufficient how vital that is. An current open supply undertaking may initially get you going fairly shortly, however as many have discovered, whenever you depart from the ‘pleased path’ issues decelerate in a short time.
There’s an argument to say that you need to do exactly what the platform gives, as a result of all media companies are principally the identical. That’s each true, and false. As I heard somebody as soon as say: generic enterprise, generic platform, huge financial savings. Many companies are basically the identical—examine most news-only firms as a first-rate instance, or firms that make biscuits (cookies within the US and Canada)—however in the event that they wish to differentiate, then a key element of this will probably be their selection and use of expertise. (And lots of different issues.)
And if all companies have been the identical, then certainly that would use Salesforce or SAP ‘out of the field’ too. ????
If a enterprise can differentiate themselves on a generic content material platform, then that’s, after all, technique selection for them. I’m going to offer a shoutout right here to The Kākā, an especially revolutionary and profitable enterprise began by Bernard Hickey. It runs on Substack, which is a publishing platform as a service, and The Kākā has differentiated itself by staying native and masking simply politics, the financial system, and the housing market. The content material has a singular voice and is content material with aptitude for pondering individuals (that’s my description). It at the moment has round 3,400 paid subscribers.
Likewise, in case you can differentiate utilizing Drupal or WordPress, and might proceed to take action, that could be a good technique selection. You simply must go deep on the evaluation to verify all of your assumptions first.
The corollary to that’s that in case you can not differentiate on an current platform, you need to do one thing else.
In March 2010 work started on the brand new CMS. As a result of we had taken a modular method to the expertise stack, and to the best way content material was structured on the web site, it was comparatively straightforward to progressively change Matrix. This modular method, and the truth that Rails itself was modular, allowed us to proceed to decouple audio internet hosting, and opened the best way decouple picture internet hosting ought to that later be wanted.
The brand new CMS was referred to as ELF. Dempsey Woodley, who was net producer on the time, got here up with the identify, which is an acronym for Eight Legged Freak. AKA a spider who lives (after all) on an online. Additionally ELFs are helpers, so double that means.
An preliminary prototype of the recipes part was constructed by Nigel Ramsey and Marcus Baguley from AbleTech. The recipes part was chosen as a result of it was unbiased of the remainder of the location (it didn’t share any content material), and we may due to this fact simply transfer it to ELF with none integration points.

The beauty of constructing your personal CMS is that you simply get precisely what you want, and no extra, as you’ll be able to see from this edit display for the recipes part (at proper).
The prototype was examined with siege (software program for efficiency testing), and located to have the ability to serve about 100 occasions extra site visitors than our current CMS, and with none optimisations reminiscent of caching. I can not recall precisely after we put that into service, nevertheless it was in all probability round April 2010.
We arrange an occasion of nginx working as a proxy server in entrance of Matrix and ELF, and this routed requests for /recipes to the ELF, and the whole lot else to Matrix. As sections or pages have been changed, the nginx config was up to date to redirect the site visitors to ELF.
One other benefit of nginx was that it may gzip compress pages passing by means of extra effectively (much less server load) than the Apache software program working Matrix. This was an surprising profit, and it purchased us a bit additional efficiency (and time) free of charge.
The recipes part had tagging, which was new for the location, and this was setup and managed by Helena Nimmo. Helena later began quite a few recipe options, reminiscent of “what’s in season”, with a collection of recipes for the month, and tagging each single recipe with its elements, to assist with search.
The preferred recipe after I left RNZ in 2016 was Alison Holst’s recipe for quince paste.
The Nationwide and Live performance homepages got here subsequent, as these had largely static content material. They have been adopted by information, programme pages and the location homepage.
We used a small variety of personal RSS feeds to share content material between the 2 CMSs through the migration course of.
The entire course of took three years, and whereas this looks as if a very long time, we had a restricted price range, business-as-usual to cater for, and we have been additionally making fixed enhancements to the location and the administration part of the ELF CMS.
The information part and web site residence web page went dwell per week earlier than 4 September 2010. This was the day of the primary Christchurch earthquake, and the outdated CMS would definitely have collapsed beneath the load, which was about 20 occasions regular. ELF dealt with it with out breaking a sweat.
The efficiency of ELF was regularly tweaked, with numerous caching regimes being launched as they have been added to the Rails framework. These labored properly, as cached content material would routinely be up to date when new content material was revealed, guaranteeing that pages loaded quick.
One of many improvements within the new platform was the automated creation of RSS and podcasts feeds. For every new information part or programme, we may swap on a feed as wanted, and the CMS would present that on the related pages. A brand new sequence web page, and podcast feed, may very well be created in beneath 5 minutes.
One other was the flexibility to import programme schedules from Phrase recordsdata. These recordsdata have been compiled in an ordinary format to ship out to The Listener. We leveraged off this format to reliably extract programme occasions, and to retailer and current them in a structured format. I wrote a parser in Ruby, and this was constructed into ELF.
The brand new CMS additionally allowed us to offer uncooked knowledge of any schedule for reuse beneath a artistic commons license. To see this in motion, go to a schedule web page like this one, after which append ‘.xml’ to the URL to get the uncooked knowledge. (This works in August 2023.)
The schedule knowledge drives all of the “What’s On” sections across the web site. The underlying code, which was constructed by Shevaun Cocker, needed to enable for information bulletins on the high of the hour in addition to different advanced eventualities. The take a look at suite for simply that module coated dozens of permutations as a result of clearly this isn’t one thing that we wished to ever break!
It’s price mentioning that each one the outdated content material from Matrix needed to be moved to ELF. This was an enormous problem due to the best way tales have been stitched collectively and offered in Matrix. There was no approach to extract the content material primarily based on URL, however as a result of the IA was constant throughout the entire web site it was doable to design an online crawler to do that work.
I wrote customized software program that visited every web page after hours (to keep away from load points) and save the uncooked HTML to native recordsdata. It might then extract solely the content material portion of every, clear up any points with the formatting routinely, after which add every merchandise to the brand new CMS, associating it with the right programme and date. In all, about 120,000 pages have been migrated.
In a blogpost written at the time, I shared a number of the code used to do the work.
ELF had a battery of technical web optimization options constructed into it. These ensured that the location may very well be simply listed by Google, but in addition that Google would come again often to index information content material. As at 2016 each web page on the location had embedded codes (from schema.org) to assist search indexing and web optimization, and this appears to largely be intact in August 2023.
These web optimization options have been added in 2014, and causes a big uptick in site visitors coming to the location by way of search and Google information.
We additionally had an enormous concentrate on accessibility, in order that the location labored properly for display reader expertise, and for these with different disabilities. It’s by no means doable to get it good, however our intention was to by no means hand over engaged on this vital space as time and assets allowed.
Efficiency was additionally all the time entrance of thoughts. After I left in 2016, it was the quickest loading media web site in New Zealand by a substantial margin. I’ll cowl a few of this in a later put up.
The RNZ search was, and possibly nonetheless is, primarily based on Apache SOLR. This was a expertise that I used to be very aware of, and the search engine I wrote may return a consequence inside a second for any search, normally quicker.
Updates to the ELF CMS may very well be deployed at any time, with none downtime, and through heavy intervals of growth this may very well be 10-15 occasions a day. The deployment system was arrange to do that even when the location was beneath heavy load. I as soon as deployed a bug repair on the night time of a New Zealand basic election, with the location beneath 10 occasions regular load.
There’s one query I’ve not answered but. What number of full-time builders did we now have engaged on the EFL CMS? The reply is none. We used AbleTech for the preliminary design, and to do massive blocks of function work three of 4 occasions a 12 months, and I did the remainder of the work. This association labored properly, as I may concentrate on small items of labor that fitted between my different duties, and I may schedule them to do the bigger blocks of labor. We did rent a full-time junior developer in 2015.
Having mentioned how nice a bespoke resolution was for us, I ought to notice that I set the bar very excessive when contemplating whether or not to depart from off-the-shelf options. I’ve seen many occasions the downsides of the build-your-own method, and the remorse of off-the-shelf-customised-beyond-recognition options. Spending a while actually calculating the overall price of possession is only one software to keep away from unhealthy decision-making on this space.
ELF-marks
One innovation we added to the CMS was the idea of ELF-marks. These have been particular codes which might be recognised by ELF as an instruction to do one thing particular with the next line of textual content. This was used primarily by information editors to format textual content and reference content material within the system with out having to know any HTML. Additionally, the iNews system utilized by the information group had solely restricted HTML assist. These are examples of some formatting codes:
[h] Heading [b] Daring paragraph [[text]] ItalicizeAn instance of an instruction code is [s].
[s] AbstractOn this case, the textual content after the [s] was extracted and used because the abstract of the article, and the road was deleted from the story earlier than it was added to the database. This was performed to work across the lack of adequate fields in iNews.
So as to add a half-sized picture with its default caption:
[image:12345:half]Which rendered like this:

There was additionally a code for audio content material. This one-liner:
http://www.radionz.co.nz/national/programmes/morningreport/audio/201807917/grey-power-chapter-petitions-for-medical-marijuana “We wish to develop it in our gardens” – Beverley Adridge on Morning Report
rendered like this:

There was a code for a pull-quote:
[pullquote] The whare is extra to us than wooden and nails. It’s an ancestral home. -Pare SannyasiThat rendered like this:

The system was capable of render exterior media reminiscent of Tweets, YouTube and Fb video, and Instagram. For instance this:
was transformed to a YouTube participant embedded within the web page. These embeds are cached in order that the textual content of embed can nonetheless be displayed if the distant service is down, a profit within the early days of Twitter.
ELF-marks eliminated the necessity for editors to chop and paste embed codes from different websites, avoiding errors, and it gave us management over how and when any third occasion Javascript was loaded. For instance, the location would solely load the Fb code when there was Fb video on a web page, one thing that was performed to restrict leakage of tourists’ private knowledge at any time when doable.
Most CMSs enable uncooked HTML, photos or hyperlinks to be added manually into pages. That is error-prone and everybody likes to have a play to make it look how they suppose it ought to. ELF-marks eradicated these issues as all HTML code for ELF-marks was rendered constantly and with out error throughout the entire web site.
One by-product of our method is that hyperlinks primarily based on ELF-marks for audio or associated tales would by no means break as a result of the system checked to see if that content material was nonetheless out there. If the unique audio or information headline is up to date, that change can be mirrored in all places, except overriding textual content is offered, as a result of the mark is a reference to the unique content material object.
Having management over the rendered HTML is a big benefit: it was doable to utterly restyle all content material throughout a redesign with out having to the touch any markup. The screenshots I included above are from an outdated weblog put up of mine. Should you go to the location at this time, you received’t see this outdated audio participant on any web page, as a result of the rendering of that is unbiased, in order that they have been all up to date routinely when the design was modified. In August 2023 it appears like this:

ELF additionally has the flexibility to render a quotes inside an audio participant otherwise, however nobody makes use of it.
For editors utilizing the CMS immediately, they might nonetheless use the fundamental formatting within the WYSIWYG editor, in addition to the ELF-marks to insert different content material.
There’s a number of additional performance constructed into ELF that has by no means been used, and many that was on the roadmap for growth reminiscent of a completely built-in information editor, dwell running a blog and options tales. Technical planning for these was partially full after I left.
Whereas we have been constructing ELF I used to be running a blog about it. RNZ have been very beneficiant in permitting me to do that, together with posting code snippets beneath an MIT license, and display pictures of private components of our methods.
In case you are listed here are hyperlinks to the 12 episodes of Rebuilding Radio NZ:
Part 4: Content Extraction & Recipes
Part 7: iPhone App Data (and an iPhone app)
Part 10: Going treeless and Modules
Web site Pace
As soon as we had our personal internet hosting and CMS, it was doable to begin fine-tuning the efficiency of the location. It’s well-known that quicker loading websites are perceived as having larger credibility. Additionally, as a result of this was a service funded by the general public, I wished it to work properly with dial-up, so if we may make it quick on dial-up, it could even higher on mounted connections.
This in all probability appears an odd purpose given shortly declining dial-up numbers, even in 2008. Regardless of that, lots of people had gradual ADSL, and 3G isn’t dissimilar to dial-up by way of efficiency. If the RNZ web site labored properly for dialup—however that it ought to work properly for everybody, being publicly funded—it may additionally be most well-liked over different websites.
There was another secret sauce utilized to get the location to be so quick.
The positioning used a mixture of staggered caching, with triggered rebuilds in numerous locations to make sure that often visited pages could be served quicker. That is built-in to Ruby On Rails, and solely wanted to be deliberate and coded.
For instance, if just one story on the house web page was up to date, then solely that story could be fetched from the database when the web page was requested, the remainder of the content material would come from quicker reminiscence cache.
The entire web site additionally sat behind Varnish—an http cache designed to maximise efficiency. Varnish was set to cache the house web page for under 10 seconds, and had a stale-while-revalidate time of 5 seconds. In Varnish that is referred to as Grace Mode, and ensures that guests by no means see gradual web page rebuilds, or any web page rebuilds. Longer occasions have been set on much less visited pages, or pages that received much less frequent updates.
Having a spread of cache occasions throughout the location, mixed with random visitation patterns, ensured that the location by no means bumped into cold-cache-meltdown circumstances. These meltdowns can happen when the cache time for all pages is about to the identical worth, and sure site visitors circumstances happen. These have been well-understood on the time, so we tuned accordingly to keep away from them.
The straightforward case of a radio host telling listeners to go to the location to see content material associated to the present was simply dealt with: the primary customer would trigger the web page to be constructed and served, the rest of requests, generally within the tens of hundreds, could be served out of Varnish. So long as requests continued, Varnish would make asynchronous requests again to ELF, primarily based on the cache and style mode settings, to refresh its copy of the web page.
The tough case of huge quantities of site visitors arriving extra randomly, after which shifting throughout pages within the web site, was dealt with by differential cache occasions on totally different pages, and cautious tuning of the caching in ELF.
This basic method meant that through the hours New Zealanders have been awake, the house web page and content material for ‘at this time’ was all the time served from a quick cache, and was by no means greater than (at worst) 15 seconds outdated.
We operated two Varnish caches, one in Auckland and one in Wellington. These caches have been linked by way of darkish fibre on to the FX networks spine. This spine was, in flip, linked to each different main ISP in as many locations as doable.
The settings on the Varnish cache in Wellington had headers that mentioned it was powered-by “One small piece of fairy cake”, with the server-type set as “The Complete Perspective Vortex”. The Auckland cache was powered-by “The Infinite Improbability Drive”.
We have been fixing an issue in a approach that’s now utilized by fashionable CDNs, the distinction on the time being the range of the connections between RNZ’s varnish servers and all different NZ ISPs far exceeded that of any CDN on the time.
In 2005 all content material supply networks had just one node in New Zealand, in Auckland, and none of those have been optimally linked for native velocity throughout the entire nation. This did save bandwidth for anybody utilizing them, and prevented having to run the required infrastructure, however have been sometimes much less performant than the method we took. Sure, our method doesn’t scale, however was adequate, a minimum of till 2016/7.
In 2023 many CDNs now have multiple node in NZ—Fastly, for instance, has three, one every in Auckland, Wellington, and Christchurch—which is an acknowledgement from the trade of the necessity for better native variety.
There are numerous optimisations that can be utilized with fashionable CDNs that may make an enormous distinction in efficiency, however many websites select to simply run the fundamental out-of-the-box settings.
Our method meant that most individuals in New Zealand who requested a web page would see a minimum of the textual content and pictures in lower than 700 milliseconds. Our goal was to attain a Speed Index (SI) of 1.5 seconds, which is taken into account very fast, and we have been all the time forward of most different media web sites, each globally and regionally.
To place that into context at this time in August 2023, RNZ’s SI 1.6 seconds. By means of comparability NZ Herald is 9.5 seconds and Stuff is 5.6 seconds, so RNZ nonetheless has a big benefit. I’ve to acknowledge the spectacular work performed by the group at RNZ to take care of this edge.
The ELF Rails software was working beneath Phusion Passenger Professional version utilizing nginx, which is a sturdy and extremely performant mixture, that additionally lets you do seamless updates to code on the dwell web site.
The RNZ web site was (and nonetheless is) so quick that it’s faster to browse the web site by way of the iPhone’s net browser than to make use of the native app that was launched in 2017!
Improvement Course of
Some firms can have a seperate product technique for his or her web site, and will also have a seperate group working inside the IT division. It is a mistake. A serious selection we made was to have and built-in technique and a cross-functional group engaged on CMS issues alongside the workers utilizing the system.
My group would additionally discuss to public customers of the location on a weekly foundation.
This ensured a closed-loop connection between these utilizing the location, these creating the content material, and people making the options to assist the story-telling. On this mannequin we have been focussed on creating options to unravel the issues of our colleagues (and the general public), and this was performed collaboratively.
Anybody may report an issue that wanted fixing, and we’d work on discovering an answer. One course of I used quite a bit (and nonetheless use) was story-boarding a proposed resolution on paper. It is a quick approach to prototype, and has the benefit you could shortly redraw any body within the story and get rapid suggestions, iterating till one thing workable is arrived at. The paper-based method additionally has the good thing about being tough sufficient that it doesn’t create expectations in the best way that computerThe ELF CMS allowed us to create working prototypes too, for testing on actual content material.
The time-to-live for a small options was sometimes a day or two. Bigger items of labor may take per week, however usually issues could be damaged into small items and launched incrementally.
Within the subsequent put up I’ll cowl decisions we made for audio, programmes and schedules.