Ruby on Rails 4 is out featuring Russian Doll caching (AKA Cache Digests). In this article, I apply Russian Doll caching to one of my poorer performing Rails 3 pages using the cache_digests gem.
Have you ever cried yourself to sleep unable to find the cause of a horrendous bug in your WordPress site? Cry no more, your tears will be reshaped as blinding swords as we explore uncharted territories laced with mystical creatures.
Debugging is an often avoided topic due to the uncertainty of how best to accomplish it and the lack of powerful introspective tools. This talk will explore new territory and showcase tools that help you debug complex and difficult issues in your WordPress site.
EasyEngine - Command-Line tool to manage WordPress Sites on NginxrtCamp
EasyEngine is a Command Line Tool to Manage WordPress Sites on Nginx Server.
Apart from site management, it installs php, mysql, nginx, postfix, memcache and everything else required to run high traffic WordPress sites.
You can serve millions of page-views on $5 digitalocean plan using EasyEngine! ;-)
These slides are from WordCamp Mumbai 2014 session.
Have you ever cried yourself to sleep unable to find the cause of a horrendous bug in your WordPress site? Cry no more, your tears will be reshaped as blinding swords as we explore uncharted territories laced with mystical creatures.
Debugging is an often avoided topic due to the uncertainty of how best to accomplish it and the lack of powerful introspective tools. This talk will explore new territory and showcase tools that help you debug complex and difficult issues in your WordPress site.
EasyEngine - Command-Line tool to manage WordPress Sites on NginxrtCamp
EasyEngine is a Command Line Tool to Manage WordPress Sites on Nginx Server.
Apart from site management, it installs php, mysql, nginx, postfix, memcache and everything else required to run high traffic WordPress sites.
You can serve millions of page-views on $5 digitalocean plan using EasyEngine! ;-)
These slides are from WordCamp Mumbai 2014 session.
Speeding up your WordPress Site - WordCamp Toronto 2015Alan Lok
This is a revised talk from the May 2015 presentation I gave to WordCamp Hamilton. At the end of this presentation you should have some ideas on how to speed up your WordPress site from within (plugins, code / theme optimizations) to environmental changes.
Project Fedena and Why Ruby on Rails - ArvindArvind G SThoughtWorks
Fedena is an open source school management software based on Ruby on Rails framework. It is a web 2.0 web application being developed by Foradian Technologies. Fedena is currently in closed beta. Visit http://www.fedena.com/ or http://en.wikipedia.org/wiki/Fedena more info.
The first part is about the birth of fedena. And why we chose Ruby on Rails for its development. My team was not experienced in Ruby on Rails. Actually they had no experience on practical programming skills other than the textbook knowledge on C and C++ that they get from and Electronics and Communication degree. They are now experienced programmers in ROR and are actively involved in various opensource ROR projects.
The second part is about our experience on ROR and the advantages and disadvantages we felt while coding and deploying. The third part of the talk is about why we are giving fedena as opensource to the community. The business model of opensource software.
Debugging WordPress Performance using EasyEnginertCamp
WordPress has thousands of themes and plugins freely available. Not all of them are coded beautifully or tested with big WordPress sites. When a bad piece of code goes live on a WordPress site, it can slow down site and even crash server in some cases.
Goal of this session is to show how EasyEngine and other tools/techniques can be used to debug performance bottleneck on a WordPress site.
This will make life of developers and system admins easy.
CyberLab Training Division :
ASP.NET is a web application framework developed and marketed by Microsoft to allow programmers to build dynamic web sites. It allows you to use a full featured programming language such as C# or VB.NET to build web applications easily.
This tutorial covers all the basic elements of ASP.NET that a beginner would require to get started.
Audience
This tutorial has been prepared for the beginners to help them understand basic ASP.NET programming. After completing this tutorial you will find yourself at a moderate level of expertise in ASP.NET programming from where you can take yourself to next levels.
Prerequisites
Before proceeding with this tutorial, you should have a basic understanding of .NET programming language. As we are going to develop web-based applications using ASP.NET web application framework, it will be good if you have an understanding of other web technologies such as HTML, CSS, AJAX. etc
ASP.NET supports three different development models:
Web Pages, MVC (Model View Controller), and Web Forms.
For More Details.
Visit: http://www.cyberlabzone.com
Over the last few years, Airbnb’s frontend architecture has evolved to keep pace with the rapid advancement happening the JavaScript world. Starting as a humble Rails 2 + Prototype.js app in 2008, the frontend stack powering airbnb.com has gone through a few revisions, including a push towards single-page app architecture with Backbone.js and Handlebars.js, an adventure into isomorphic JavaScript with Rendr (our library for using Node.js to server-render Backbone SPAs), and most recently, a move toward React.js and a re-envisioning of our build pipeline to take advantage of CommonJS, ES6, and a Node.js-based transform system. Spike Brehm, software engineer on the @AirbnbNerds team, will walk through how we approached and executed on these changes. Plus, get excited to see a preview of our new approach to isomorphic JavaScript, allowing us to server-render React components from our Rails app.
Spike Brehm is a software engineer at Airbnb who specializes in building rich web experiences. As a JavaScript nerd, he has spent the last few years shipping web apps and prototyping Airbnb’s front-end stack, experimenting with “isomorphic JavaScript” — apps that have the flexibility to run on both the client and sever using the same codebase.
This presentation is just the showcase for the book that I authored with PACKT publication.
This presentation shows what all tiips/techniques we have covered to make our website more optimized for faster response using existing tools, codes and methods.
In this session you will learn:
Including Files at Request Time: jsp:include
Understanding jsp:include vs. <%@ include … %>
Options for Deploying Applets
Using jsp:plugin
Attributes of the jsp:plugin Element
Using JavaBeans Components in JSP Documents
Background: What Are Beans?
Using Beans: Basic Tasks
Setting Simple Bean Properties: jsp:setProperty
JSP Page That Uses StringBean(Code)
Conditional Bean Operations
Sharing Beans in Four Different Ways
Session-Based Sharing: Code
Application-Based Sharing: Code
Application-Based Sharing: Result
For more information, visit this link: https://www.mindsmapped.com/courses/software-development/online-java-training-for-beginners/
What you need to know to upgrade to a self-hosted WP website. An overview of WordPress website hosting options and their impact on your WordPress website. A visual map of the site setup path through Dashboard menus and settings.
In this session we will present an overview from the point of view 'system that implementative on how to get the best performance from your drupal application.
We will also show examples of use cases for drupal scalable infrastructure.
Speeding up your WordPress Site - WordCamp Toronto 2015Alan Lok
This is a revised talk from the May 2015 presentation I gave to WordCamp Hamilton. At the end of this presentation you should have some ideas on how to speed up your WordPress site from within (plugins, code / theme optimizations) to environmental changes.
Project Fedena and Why Ruby on Rails - ArvindArvind G SThoughtWorks
Fedena is an open source school management software based on Ruby on Rails framework. It is a web 2.0 web application being developed by Foradian Technologies. Fedena is currently in closed beta. Visit http://www.fedena.com/ or http://en.wikipedia.org/wiki/Fedena more info.
The first part is about the birth of fedena. And why we chose Ruby on Rails for its development. My team was not experienced in Ruby on Rails. Actually they had no experience on practical programming skills other than the textbook knowledge on C and C++ that they get from and Electronics and Communication degree. They are now experienced programmers in ROR and are actively involved in various opensource ROR projects.
The second part is about our experience on ROR and the advantages and disadvantages we felt while coding and deploying. The third part of the talk is about why we are giving fedena as opensource to the community. The business model of opensource software.
Debugging WordPress Performance using EasyEnginertCamp
WordPress has thousands of themes and plugins freely available. Not all of them are coded beautifully or tested with big WordPress sites. When a bad piece of code goes live on a WordPress site, it can slow down site and even crash server in some cases.
Goal of this session is to show how EasyEngine and other tools/techniques can be used to debug performance bottleneck on a WordPress site.
This will make life of developers and system admins easy.
CyberLab Training Division :
ASP.NET is a web application framework developed and marketed by Microsoft to allow programmers to build dynamic web sites. It allows you to use a full featured programming language such as C# or VB.NET to build web applications easily.
This tutorial covers all the basic elements of ASP.NET that a beginner would require to get started.
Audience
This tutorial has been prepared for the beginners to help them understand basic ASP.NET programming. After completing this tutorial you will find yourself at a moderate level of expertise in ASP.NET programming from where you can take yourself to next levels.
Prerequisites
Before proceeding with this tutorial, you should have a basic understanding of .NET programming language. As we are going to develop web-based applications using ASP.NET web application framework, it will be good if you have an understanding of other web technologies such as HTML, CSS, AJAX. etc
ASP.NET supports three different development models:
Web Pages, MVC (Model View Controller), and Web Forms.
For More Details.
Visit: http://www.cyberlabzone.com
Over the last few years, Airbnb’s frontend architecture has evolved to keep pace with the rapid advancement happening the JavaScript world. Starting as a humble Rails 2 + Prototype.js app in 2008, the frontend stack powering airbnb.com has gone through a few revisions, including a push towards single-page app architecture with Backbone.js and Handlebars.js, an adventure into isomorphic JavaScript with Rendr (our library for using Node.js to server-render Backbone SPAs), and most recently, a move toward React.js and a re-envisioning of our build pipeline to take advantage of CommonJS, ES6, and a Node.js-based transform system. Spike Brehm, software engineer on the @AirbnbNerds team, will walk through how we approached and executed on these changes. Plus, get excited to see a preview of our new approach to isomorphic JavaScript, allowing us to server-render React components from our Rails app.
Spike Brehm is a software engineer at Airbnb who specializes in building rich web experiences. As a JavaScript nerd, he has spent the last few years shipping web apps and prototyping Airbnb’s front-end stack, experimenting with “isomorphic JavaScript” — apps that have the flexibility to run on both the client and sever using the same codebase.
This presentation is just the showcase for the book that I authored with PACKT publication.
This presentation shows what all tiips/techniques we have covered to make our website more optimized for faster response using existing tools, codes and methods.
In this session you will learn:
Including Files at Request Time: jsp:include
Understanding jsp:include vs. <%@ include … %>
Options for Deploying Applets
Using jsp:plugin
Attributes of the jsp:plugin Element
Using JavaBeans Components in JSP Documents
Background: What Are Beans?
Using Beans: Basic Tasks
Setting Simple Bean Properties: jsp:setProperty
JSP Page That Uses StringBean(Code)
Conditional Bean Operations
Sharing Beans in Four Different Ways
Session-Based Sharing: Code
Application-Based Sharing: Code
Application-Based Sharing: Result
For more information, visit this link: https://www.mindsmapped.com/courses/software-development/online-java-training-for-beginners/
What you need to know to upgrade to a self-hosted WP website. An overview of WordPress website hosting options and their impact on your WordPress website. A visual map of the site setup path through Dashboard menus and settings.
In this session we will present an overview from the point of view 'system that implementative on how to get the best performance from your drupal application.
We will also show examples of use cases for drupal scalable infrastructure.
The asset pipeline provides a framework to concatenate and minify or compress JavaScript and CSS assets. It also adds the ability to write these assets in other languages and pre-processors such as CoffeeScript, Sass and ERB.
Video at http://www.youtube.com/watch?v=HaJnhYPLvx0
Large Drupal projects will generally have a themer or five working alongside the developers, site builders and designers. Themers are the magicians who transform what Drupal wants to do into what the designer wants it to do.
Smaller projects also usually need someone on the team who can make sense of Drupal's output, knows more CSS and JS than anyone else and can configure Views with their eyes closed.
The thing is — and whisper this, if possible redundancy concerns you — we can bypass the themer entirely.
With some simple configuration, a site builder can get Drupal to output exactly the semantic, lightweight markup that any modern front-end designer would be proud of. The designer can be left alone to write the most appropriate HTML, CSS and JS, while the site builder need only choose a couple of options when putting together content types, views and panels to make Drupal behave.
A friendly developer may have to lend a hand every now and then, but that’s it. You can get rid of the themer altogether.
http://2013.drupalcamplondon.co.uk/session/death-themer
Sooner or later we all have to work with HTML, despite its verbosity. Those of us who claim to love HTML may just be victims of Stockholm Syndrome, both praising yet secretly loathing it.
Basho designer John Newman is making the trek from the swamps of Florida to show us the way. In the modern world of markup preprocessors, these alternative syntaxes allow you to write simpler, cleaner, more concise code in a shorter amount of time. Certain techniques can even allow your team members who may be less-tech-savvy to contribute content directly without forcing you to wire up a WYSIWYG style CMS.
This talk explores great alternatives to plain HTML and CSS, and covers how Basho put these tools together to facilitate a painless, team-oriented approach to building sites and web apps.
<p>Your Drupal 8 site is fantastic: you've spent hours/weeks/months working on it, the work is flawless and the customer is delighted - what are you going to need to fly this thing? Which PHP tips, tricks and tunings will help your site perform exceptionally at scale. </p>
<p>There are some significant differences in PHP/FPM performance tuning between Drupal 7 and Drupal 8, and this session will help you understand them. The old adage is true: the more things change, the more they stay the same - we'll revisit some of the 'tried and true' tips to keep your sites up and performant in the crush of traffic that occurs when your content goes viral. </p>
<p>Join us to learn about:</p>
<ul>
<li>Brief glance over Best Practices for Performance Tuning</li>
<li>PHP tuning including OPcache and APC User Cache</li>
<li>Varnish, Memcache, and Database tips</li>
<li>The Software Stack, with Drupal 8 integration tips.</li>
</ul>
More and more often we talks about optimizing the server-side software, but the
true optimization must be done on the client where 80% of the time is spent
by users. The talk explains the main techniques to optimize
Web site using HTTP protocols and rules to the base but rarely
used.
Organizations focus process optimization of
Data Tier
Application Tier
Presentation Tier is usually ignored.
Presentation Tier is responsible for more than 30% of Client/Server application performance.
The presentation of the Drupal frontend optimizations from Drupal Camp LA 2011. The slides go over optimizations you do in the backend to serve files in the frontend faster and optimizations in the front end to css and javascript to make that aspect run faster.
Similar to The War on ActionView with Russian Doll Caching (20)
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
Accelerate your Kubernetes clusters with Varnish CachingThijs Feryn
A presentation about the usage and availability of Varnish on Kubernetes. This talk explores the capabilities of Varnish caching and shows how to use the Varnish Helm chart to deploy it to Kubernetes.
This presentation was delivered at K8SUG Singapore. See https://feryn.eu/presentations/accelerate-your-kubernetes-clusters-with-varnish-caching-k8sug-singapore-28-2024 for more details.
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Ramesh Iyer
In today's fast-changing business world, Companies that adapt and embrace new ideas often need help to keep up with the competition. However, fostering a culture of innovation takes much work. It takes vision, leadership and willingness to take risks in the right proportion. Sachin Dev Duggal, co-founder of Builder.ai, has perfected the art of this balance, creating a company culture where creativity and growth are nurtured at each stage.
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
UiPath Test Automation using UiPath Test Suite series, part 4DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 4. In this session, we will cover Test Manager overview along with SAP heatmap.
The UiPath Test Manager overview with SAP heatmap webinar offers a concise yet comprehensive exploration of the role of a Test Manager within SAP environments, coupled with the utilization of heatmaps for effective testing strategies.
Participants will gain insights into the responsibilities, challenges, and best practices associated with test management in SAP projects. Additionally, the webinar delves into the significance of heatmaps as a visual aid for identifying testing priorities, areas of risk, and resource allocation within SAP landscapes. Through this session, attendees can expect to enhance their understanding of test management principles while learning practical approaches to optimize testing processes in SAP environments using heatmap visualization techniques
What will you get from this session?
1. Insights into SAP testing best practices
2. Heatmap utilization for testing
3. Optimization of testing processes
4. Demo
Topics covered:
Execution from the test manager
Orchestrator execution result
Defect reporting
SAP heatmap example with demo
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
Keynote at DIGIT West Expo, Glasgow on 29 May 2024.
Cheryl Hung, ochery.com
Sr Director, Infrastructure Ecosystem, Arm.
The key trends across hardware, cloud and open-source; exploring how these areas are likely to mature and develop over the short and long-term, and then considering how organisations can position themselves to adapt and thrive.
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfPaige Cruz
Monitoring and observability aren’t traditionally found in software curriculums and many of us cobble this knowledge together from whatever vendor or ecosystem we were first introduced to and whatever is a part of your current company’s observability stack.
While the dev and ops silo continues to crumble….many organizations still relegate monitoring & observability as the purview of ops, infra and SRE teams. This is a mistake - achieving a highly observable system requires collaboration up and down the stack.
I, a former op, would like to extend an invitation to all application developers to join the observability party will share these foundational concepts to build on:
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfPeter Spielvogel
Building better applications for business users with SAP Fiori.
• What is SAP Fiori and why it matters to you
• How a better user experience drives measurable business benefits
• How to get started with SAP Fiori today
• How SAP Fiori elements accelerates application development
• How SAP Build Code includes SAP Fiori tools and other generative artificial intelligence capabilities
• How SAP Fiori paves the way for using AI in SAP apps
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
Are you looking to streamline your workflows and boost your projects’ efficiency? Do you find yourself searching for ways to add flexibility and control over your FME workflows? If so, you’re in the right place.
Join us for an insightful dive into the world of FME parameters, a critical element in optimizing workflow efficiency. This webinar marks the beginning of our three-part “Essentials of Automation” series. This first webinar is designed to equip you with the knowledge and skills to utilize parameters effectively: enhancing the flexibility, maintainability, and user control of your FME projects.
Here’s what you’ll gain:
- Essentials of FME Parameters: Understand the pivotal role of parameters, including Reader/Writer, Transformer, User, and FME Flow categories. Discover how they are the key to unlocking automation and optimization within your workflows.
- Practical Applications in FME Form: Delve into key user parameter types including choice, connections, and file URLs. Allow users to control how a workflow runs, making your workflows more reusable. Learn to import values and deliver the best user experience for your workflows while enhancing accuracy.
- Optimization Strategies in FME Flow: Explore the creation and strategic deployment of parameters in FME Flow, including the use of deployment and geometry parameters, to maximize workflow efficiency.
- Pro Tips for Success: Gain insights on parameterizing connections and leveraging new features like Conditional Visibility for clarity and simplicity.
We’ll wrap up with a glimpse into future webinars, followed by a Q&A session to address your specific questions surrounding this topic.
Don’t miss this opportunity to elevate your FME expertise and drive your projects to new heights of efficiency.
Essentials of Automations: Optimizing FME Workflows with Parameters
The War on ActionView with Russian Doll Caching
1. On Building
:
The War on ActionView
with Russian Doll Caching
Peter Lombardo
http://blog.gameface.in
http://www.appneta.com/blog
2. Peter Lombardo
I’ve been a Rubyist and Linux addict for over a decade, mainly
developing in Ruby and JavaScript (as well as PHP and Perl). I’m the
creator of numerous software tools and applications, most recently
Password Pusher, a Ruby on Rails application to communicate
passwords over the web and Gameface, a social networking
platform for gamers using Rails 3.
When I’m not creating my own applications, I help develop and
maintain the infrastructure at OurStage and manage the Ruby
community for AppNeta.
3. “Gameface was created to
showcase games,
the people who play them,
and the characters they play”
4.
5. Rails 4 is out featuring Russian Doll
caching (AKA Cache Digests). In this
article, I apply Russian Doll caching
to one of my poorer performing Rails
3 pages using the cache_digests
gem.
This article was originally featured
on AppNeta’s Application
Performance Blog. Check it out!
https://github.com/rails/cache_digests
6. ActionView templates are great. They are easy
to code, manage and extend but the one thing
they are not is fast…at least not out of the box.
In this article, I’ll be using AppNeta’s
TraceView to time ActionView performance. If
you haven’t used TraceView before, checkout
my previous article Instrumenting Ruby on
Rails with TraceView.
http://www.appneta.com/products/traceview/
8. ActionView puts forth a great
development pattern of layouts,
views and partials that is easy
to understand, implement and
maintain but that comes at a
cost: The rendering process is
complex and slow.
9.
10. The previous screenshot shows the timings for
the Users#show URL on Gameface. The page
in question is fairly straight forward containing
four components: a topbar, sidebar, user
details and a listing of game characters.
With no caching at all, the ActionView layer
averages roughly ~365ms for this URL. This
represents over 80% of average request
processing time and dwarfs all of the other
layers combined.
http://gameface.in/
11.
12. In terms of performance, ActionView
is a weapon of mass destruction and
is the low-hanging fruit for
improvement.
14. Russian Doll caching is a type of
nested fragment caching that auto
expires fragments when object
timestamps change.
15. You still make the same calls as previous
fragment caching schemes in Rails:
- cache @user do
(user view data)
- cache [ 'details', @user ] do
(user details view data)
- cache [ 'characters', @user ] do
- @user.characters.each do |character|
- cache character do
(character view data)
16. With Russian Doll caching (AKA cache
digests) unique cache keys are formed
using an md5 stamp based on the
timestamp of the object being cached:
views/users/320130530135425/7a1bb8bb15b02ee7aa69cec1d5f6f630
views/details/users/320130530135425/6f28ec6d31e7e3b73a575777d59e63ca
The advantage of this is that when objects
are updated and outer fragments are
automatically invalidated, nested fragments
can be re-used. (russian dolls)
17. A key requirement to this is that children
objects should update the timestamps of their
parent object by using ActiveRecord touch
option. This will allow for automatic cache
invalidation and avoid serving stale content.
class Character < ActiveRecord::Base
belongs_to :user, touch: true
end
19. When caching, it’s best to avoid caching
logged-in content since the same caches
will get served to all users regardless of
any logged in status.
20. For effective (and less problematic)
fragment caching, designing the page
well to separate out logged in content is
critical.
Below is the layout for the Gameface
profile view before re-design. Logged in
specific content and links are sprinkled
throughout the page making it hard to
divide it up into cache-able fragments.
21.
22. Properly caching this page as-is would
be complicated and inefficient since we
would have to tip-toe around logged-in
content.
24. To fix this, I re-organized the page to
group the logged-in specific content into
one specific area. With logged-in content
out of the way, we are then free to cache
the rest of the page in well-defined
fragments.
27. With the page re-design and Russian
Doll fragment caching applied to the
large majority of the page, we now
average a much better ~120ms for
ActionView on that URL. A reduction of
265ms (67%) in average processing
time.
28.
29. On top of the performance improvement,
we also get automatic cache invalidation
as object timestamps are updated. This
greatly simplifies the whole system by not
requiring cache sweepers or other tricks
to invalidate stale caches.
31. Russian Doll caching is a small but significant
improvement over prior caching in Rails. When
used effectively, it can greatly reduce server
side ActionView processing and automatically
expire stale fragments.
We took a previously un-cached URL with a
poor page layout that was averaging ~365ms
of processing in ActionView and reduced that
number to ~120ms for a 67% performance
improvement.
33. When using fragment caching, note which
backing cache store you are using. The default
cache store in Rails is the filesystem but you
can get even greater performance by backing
your cache store with memcache or redis
instead.
See the redis-rails gem as an example.
https://github.com/redis-store/redis-store/tree/master/redis-rails
35. Separate out logged-in content from
agnostic content for best cache
coverage. Page design affects caching
efficiency.
36. When possible, always call cache with
the object being cached. Cache keys and
their eventual invalidation will be keyed
off of the timestamp on the object being
cached.
- cache @user do
(user view data)
- cache [ 'details', @user ] do
(user details view data)
37. To cache an index of objects, you have to
revert to manually passing in the
expires_in option since there is no single
object timestamp to key off of.
- cache 'user list', expires_in: 30.minutes do
(user list view data)
38. Update belongs_to model relationships with
touch: true so that parent fragment caches
can be invalidated when children are updated.
Collect timing data before and after to quantify
and validate changes.