Performance Boosts
Performance is the essence of your website. A slow website has several disadvantages. To improve the performance of your Umbraco site, there are many things you can do. And they won’t even cost you a lot of time. If you want to get a good search engine ranking and not scare away your users, read on for tips and methods.
In this article, I don’t want to write about how to push your site’s performance to the maximum, I will rather tell you about methods you can use on the fly without investing a lot of extra time on your site. If you apply these methods successfully, you will spend close to no extra time on optimising your performance.
“Caching is for sites with performance problems or for people who have too much time.” – Chances are, some of you have heard a phrase like this on your way to become developer. I’m not entirely sure anymore where I heard it but that’s not why I’m telling you this anyway. I’m telling you because of its message. And the message is – as you probably know – complete nonsense. Caching is essential to boost your site and to get the most out of it. “But what if the site runs quickly already?” – My answer to this question: You can always make it quicker. Plus, caching barely takes any time.
© Douglas Robar
byte5-Entwickler und Umbraco-Genius Lukas Schuhmacher
What can be written almost as quickly as @Html.Partial? You’re right, it’s @Html.CachedPartial! If you have already spent some development time thinking about where it makes sense to use CachedPartials instead of regular Partials, this procedure does not take a lot of time. You can also set further parameters, such as cachedByPage which allows you to get a separate cache per each type of site you have running on Partial, or cachedByMember with which you can cache for members.
While developing, CachedPartials won’t get in your way as they only cache with the debug mode set on false. Another thing to keep in mind is that the Partials cache is emptied by Umbraco publish events.
How often do we make queries where we know beforehand that they will always provide the same data? Like when we use an WebApi to get settings from the backend. Why should you wait longer than necessary for an answer – especially when WebApi.OutputCache is working in one line? WebApi.OutputCache.V2 is a Nuget package. After the installation, you can apply an attribute to your methods and thereby cache them. See the following example:
There are a handful of variations of the output cache: CacheOutputUntil, CacheOutputUntilToday, CacheOutputUntilThisMonth and CacheOutputUntilThisYear. These serve the purpose of setting a specific time at which the site is supposed to be cached.
LeBlender is a free Umbraco package. It lets you build complex grid editors effortlessly. I, for one, could not imagine working without it anymore.
Just build your new grid editor in the developer section as you always do. In the “select a grid editor” section, choose LeBlender Editor.
Screenshot von LeBlender
Now you can simply add properties. You can also use your own datatypes. LeBlender has a built-in cache. You only need to type in the cache period et voilà. You have already done a lot for your site, if you appropriately use the cache period in all editors.
Those of you who don’t know LeBlender yet, should definitely read this: https://our.umbraco.org/projects/backoffice-extensions/leblender/
Umbraco-Package LeBlender im Backend
The most important thing, no matter which kind of caching you’re planning on doing, is to do some thinking about how often data changes in your project and how important it is to have the latest data available at all times – either while you’re developing or even better: before you start. Does it make a difference whether the new data is updated right away or in two hours? If the answer to that question is “no”, you should definitely cache. Consistent caching also gives you additional advantages, some of them with tremendous effects.
Some of you probably work with systems other than Umbraco which your client pays for per call. If you cache the result of a call, instead of having thousands of calls you might only have one. Your client will be pleased.
Another advantage is the working method caching offers. By thinking about data flow from an early point onwards, you avoid errors causing more problems the later they are found. Your team leaders will be eternally grateful.
“Quicker load time or not, if the users of the site don’t need to wait for too long, it’s all the same, isn’t it? After all, they won’t notice one hundred milliseconds more or less.” – The user might not, but the search engine certainly will! Caching has a positive influence on the speed of indexing a site which can help you get a better ranking.
Additionally, you should always pay attention to using typed content. As a general rule, typed content is more performant than Dynamics. Therefore, it is less prone to errors. If you still work with Dynamics, now would be a good time to change since support for Dynamics via IPublishedContent will cease with the introduction of Umbraco version 8.
If you’re new to Umbraco, there are a handful of rules which you should pay attention to in order to avoid errors. I want to send you off with a related our.umbraco article I highly recommend: https://our.umbraco.org/documentation/Reference/Common-Pitfalls/
This article was first featured on 20 December 2017 on 24 Days in Umbraco.
Aktuelle Blogposts
08.04.2025
Review of our Meetup
Laravel Cloud & Laravel 12: Review of our March Meetup
Laravel Cloud and Laravel 12 in focus: At the last DACH Meetup, there were exciting insights into the new releases and their impact on everyday developer life.
20.12.2024
AI, trust, accessibility & search
Digital Challenges and Trends 2025
Danish digital pioneer Janus Boye once again took the time to talk to us about the challenges and trends in the digital sector. What characterised the industry in 2024 and what can we expect in 2025?
10.12.2024
What you should NOT do in Laravel
In our Laravel Meetup in November, we looked at bad practices and programming fails in Laravel together. PHP developer Jure shares 3 examples from the meetup.
19.08.2024
How to make content editors happy
Umbraco Backoffice
As a web service provider, our goal is to design a backend in such a way that our customers' content editors can work independently and intuitively in the backend. We'll show you our 3 core principles for building backends in Umbraco.
06.08.2024
Data security redefined
Zero-Knowledge Proof
Zero-Knowledge Proofs (ZKProofs) are revolutionizing data protection and security. Discover the functionality, applications and advantages of this innovative technology for companies and modern cryptography.
More questions
about performance!
Contact the performance experts