From the Kitchen of the Restaurant of Mistaken Orders: Whipping Up Faster Loading Speeds with 'From Path' in Sitecore Content Hub
Bonjour, tech gourmets! Chef Roel here, whisking up another delectable dish from the bustling kitchen of the Restaurant of Mistaken Orders. Today's special on the menu: A deep dive into the delightful world of Sitecore Content Hub, React components, and the ever-so-crucial choice between "From path" and "From asset". Grab your forks and let's dig in! 🍽️
The Appetizer: Setting the Table
Before we dive into the main course, let's set the table with some context. When working with Sitecore Content Hub and React, we often face the conundrum of how to link to an external React component. The two most popular choices are:
- From asset: This method links directly to the asset.
- From path: This method links to the component's path.
Now, I know what you're thinking: "Chef, isn't linking directly to the asset the quickest way to get to the dessert?" Ah, my discerning diners, this is where the plot thickens!
The Main Course: Why "From path" is the Crème de la Crème
1. Straight to the Source:
Using "From path" lets you link directly to the component's path. Think of it like having a shortcut to the freshest ingredients in your pantry. No more rummaging through aisles and shelves!
2. Speedy Service with Portal Assets:
When your React component resides in the Portal Assets, the serving time is even faster. Imagine this: You're hosting a grand feast and instead of fetching wine from the cellar in a distant vineyard (like an Azure environment), you grab a bottle from the wine rack right in your dining room. Swift, efficient, and oh-so-convenient!
A Side Dish: How to Measure Serving Speed
Now, for those of you who love to time your soufflés to perfection, here's a nifty trick to measure the speed difference between the two methods:
- Fire up your browser and head to your Sitecore Content Hub.
- Open Developer Tools (typically F12 or right-click > Inspect).
- Navigate to the 'Network' tab. This is where the magic happens!
- Reload your page.
- Sort the results by 'Time' to see how long each component takes to load.
Now, perform this for both "From asset" and "From path" (especially when linked from Portal Assets) and see the difference for yourself. Just like how some soups simmer slowly and others boil up quickly, you'll notice a delightful difference in loading times.
The Dessert: Wrapping Up with Some Sugar
So, dear diners, the next time you find yourself pondering the pathways in Sitecore Content Hub, remember our little culinary adventure today. "From path", especially from Portal Assets, is the way to go if you fancy a swift, efficient, and flavorsome experience.
As always, from the bustling stoves of the Restaurant of Mistaken Orders, we aim to serve you not just meals, but experiences. And remember, in the world of tech (and cooking), it's always the little details that spice things up!
Bon Appétit! 🍷🍝