php ey final
TRANSCRIPT
![Page 1: Php ey final](https://reader035.vdocuments.net/reader035/viewer/2022062310/588082c71a28ab35718b5127/html5/thumbnails/1.jpg)
A Pure Digital News Service for Ireland
14 Adorable Pictures of Cats Coding
How We Grew TheJournal.ie
John Needham – Web Developer
![Page 2: Php ey final](https://reader035.vdocuments.net/reader035/viewer/2022062310/588082c71a28ab35718b5127/html5/thumbnails/2.jpg)
Who Are We?•Irish and International Content•News, Sports, Entertainment and discussion•Launched Sept 2010•iOS and Android apps•Desktop and touch
websites
![Page 3: Php ey final](https://reader035.vdocuments.net/reader035/viewer/2022062310/588082c71a28ab35718b5127/html5/thumbnails/3.jpg)
Who Are We?
•25 Journalists•2 Web Developers•2 App Developers•1 Cat
![Page 4: Php ey final](https://reader035.vdocuments.net/reader035/viewer/2022062310/588082c71a28ab35718b5127/html5/thumbnails/4.jpg)
Site Launch
Basic Wordpress site:
• Quick to build• Large feature set• Large and experienced WP talent pool• Lots of online help• Good CMS
Launched our iOS app within first monthAndroid app Feburary 2011
![Page 5: Php ey final](https://reader035.vdocuments.net/reader035/viewer/2022062310/588082c71a28ab35718b5127/html5/thumbnails/5.jpg)
Site Growth
1 million page views a month after 3 months:
• WP does not scale easily• Lots of features = Complex code base• Debugging a nightmare (hooks..)• No native caching• ( °□°╯ )╯︵ ┻━┻
![Page 6: Php ey final](https://reader035.vdocuments.net/reader035/viewer/2022062310/588082c71a28ab35718b5127/html5/thumbnails/6.jpg)
Site Growth - Maintenance
Developing in WordPress:
• Tried to use the WP framework (plugins)• Slow and messy (hooks)
Gave Up:
• Edit the core code• Faster development• Upgrading issues
![Page 7: Php ey final](https://reader035.vdocuments.net/reader035/viewer/2022062310/588082c71a28ab35718b5127/html5/thumbnails/7.jpg)
Site Growth - Maintenance
$query->get_posts();1 Function – 875 lines
![Page 8: Php ey final](https://reader035.vdocuments.net/reader035/viewer/2022062310/588082c71a28ab35718b5127/html5/thumbnails/8.jpg)
Site Growth - Caching
Caching in WordPress is a nightmare:
• All plugin based• Used w3-cache - cached to file• Dynamic Elements – not maintainable• Want to increase amount of user specific content
![Page 9: Php ey final](https://reader035.vdocuments.net/reader035/viewer/2022062310/588082c71a28ab35718b5127/html5/thumbnails/9.jpg)
Site Growth – Reliability
Dara O'Briain – crashes the site with only 10k views
![Page 10: Php ey final](https://reader035.vdocuments.net/reader035/viewer/2022062310/588082c71a28ab35718b5127/html5/thumbnails/10.jpg)
Solutions?
Buy – options are too customised
More Cache (varnish?) – wont fix dynamic content problem
Build New System – Resources and time?
![Page 11: Php ey final](https://reader035.vdocuments.net/reader035/viewer/2022062310/588082c71a28ab35718b5127/html5/thumbnails/11.jpg)
Our Solution
Goal – Build a simple API to power site and apps
• Use WordPress database, keep the CMS• Cherry-pick from WordPress for formatting and styling
• Lightweight and simple PHP front end• All in EC2
![Page 12: Php ey final](https://reader035.vdocuments.net/reader035/viewer/2022062310/588082c71a28ab35718b5127/html5/thumbnails/12.jpg)
Site Structure
![Page 13: Php ey final](https://reader035.vdocuments.net/reader035/viewer/2022062310/588082c71a28ab35718b5127/html5/thumbnails/13.jpg)
Challenges - Caching
110,000 posts 100,000 tag rivers 1,063,000 comments
Solution:• Cache all objects forever• Cache all rivers by IDs• Immediate cache invalidation
![Page 14: Php ey final](https://reader035.vdocuments.net/reader035/viewer/2022062310/588082c71a28ab35718b5127/html5/thumbnails/14.jpg)
Challenges - Content
Making Content Work Everywhere
• Platforms: browser, iOS and Android• Rich media support? (flash, silverlight, gifs)
Journalists. Awkward.
![Page 15: Php ey final](https://reader035.vdocuments.net/reader035/viewer/2022062310/588082c71a28ab35718b5127/html5/thumbnails/15.jpg)
Challenges - Content
Solution:
• Make our server do as much heavy lifting as possible
• Keep app html parsing to zero• Handle unknown embeds as a link• A lot easier to update a server than an app
![Page 16: Php ey final](https://reader035.vdocuments.net/reader035/viewer/2022062310/588082c71a28ab35718b5127/html5/thumbnails/16.jpg)
Challenges - Content
- Faster render time for apps
- Unknown content still accessible
![Page 17: Php ey final](https://reader035.vdocuments.net/reader035/viewer/2022062310/588082c71a28ab35718b5127/html5/thumbnails/17.jpg)
Mistakes along the way
Overdependent on external plugins• Liveblogs, JSON API, Social
Could have made better use of (small) frameworks• Avoid learning lessons the hard way.• Slim Framework
Doing Friday Deploys
![Page 18: Php ey final](https://reader035.vdocuments.net/reader035/viewer/2022062310/588082c71a28ab35718b5127/html5/thumbnails/18.jpg)
Mistakes along the way
EC2 does quirky things:
• Random IP changes causing an accidental DDoS
• Unpredictable Auto-Scaling – killing a healthy Varnish instance
![Page 19: Php ey final](https://reader035.vdocuments.net/reader035/viewer/2022062310/588082c71a28ab35718b5127/html5/thumbnails/19.jpg)
Mistakes along the way
Keeping Clients in Sync
• Could stop comment on apps, not on desktop...
![Page 20: Php ey final](https://reader035.vdocuments.net/reader035/viewer/2022062310/588082c71a28ab35718b5127/html5/thumbnails/20.jpg)
Some Lessons Learned Lots of good start-ups to use:
• Pusher – realtime websocket api, used on liveblogs and scores
• HostedGraphite – hassle free stats, essential for our API
![Page 21: Php ey final](https://reader035.vdocuments.net/reader035/viewer/2022062310/588082c71a28ab35718b5127/html5/thumbnails/21.jpg)
Some Lessons Learned
Profile EVERYTHING
• Xhprof• 3x load time improvement
![Page 22: Php ey final](https://reader035.vdocuments.net/reader035/viewer/2022062310/588082c71a28ab35718b5127/html5/thumbnails/22.jpg)
Some Lessons Learned
Know when Good Enough is OK:
• Too tempting to try and perfect everything• Ship it, Iterate
Hat tip: @dermdaly
![Page 23: Php ey final](https://reader035.vdocuments.net/reader035/viewer/2022062310/588082c71a28ab35718b5127/html5/thumbnails/23.jpg)
Results
Desktop Growth in 2012:
![Page 24: Php ey final](https://reader035.vdocuments.net/reader035/viewer/2022062310/588082c71a28ab35718b5127/html5/thumbnails/24.jpg)
Results
3x mobile growth in 2012:
![Page 25: Php ey final](https://reader035.vdocuments.net/reader035/viewer/2022062310/588082c71a28ab35718b5127/html5/thumbnails/25.jpg)
Results
Traffic?• Handling 50 million page views a month
Spikes?• Reddit test 2 weeks ago• 477,735 page views• No crash :)
![Page 26: Php ey final](https://reader035.vdocuments.net/reader035/viewer/2022062310/588082c71a28ab35718b5127/html5/thumbnails/26.jpg)
Results
Rolling out new features on new site
• Easier to release new features
• Live scores rolled out over last few weeks
![Page 27: Php ey final](https://reader035.vdocuments.net/reader035/viewer/2022062310/588082c71a28ab35718b5127/html5/thumbnails/27.jpg)
Going Forward
Continue our growth – 3x in 3 years Build our commenter communityNumber 1 news service in Ireland by next year
![Page 28: Php ey final](https://reader035.vdocuments.net/reader035/viewer/2022062310/588082c71a28ab35718b5127/html5/thumbnails/28.jpg)
We're Hiring!
www.thejournal.ie/jobs/
Can find me @JohnANeedham
Thanks to:Miguel MolinaBrian Fallon (@brianfallon)Paul Conroy (@conroyp)Steven McMemeBride (@steemcb)