DEV Community

Anthony Cook
Anthony Cook

Posted on

Headless commerce and why it rocks

Headless is the next big step in the ecommerce world, it essentially allows you to build your public facing storefronts independently of your ecommerce platform and backend.

This comes with huge benefits including performance, customisation and scalability. There's a lot of reasons why big brands are flocking towards the headless paradigm, so let's discuss some of those now.

Complete Control Of URL's

On most ecom platforms you have to conform to their URL structure and categorisation. A good example of this is Shopify, all of their product URL's are prefixed with /products and all of their categories are prefixed with /collections, couple this with the fact that there isn't a way to have truly nested categories URL's means SEO can be challenging.

Let's look at what an ideal URL structure would be for a mens t-shirt with a picture of a pineapple on it:

/mens/t-shirts/pineapple-shirt

We cloud even go deeper, like so:

/mens/t-shirts/blue/large/pineapple-shirt

This is great for SEO and clearly shows what your looking at, both to people and machines alike.

The issue is that on a lot of eCom platforms, this would simply not be possible. Using Shopify as an example again, the nearest we can get achieve to this ideal structure is:

   /collections/mens/products/pineapple-shirt

Not great right? Not only do we have the words collections and products tucked in every URL, we also can't nest more than one category deep, yikes!

In my past experiences, no ecom platform provides the perfect solution to structured URL's but luckily headless fixes this because you have complete control over your store's front end, you can structure your URL's to how you see fit. This is great as I strongly believe that there is no one size fits all solution when it comes to how you structure your product data.

Language Agnostic

When using any ecommerce platform it usually comes with a templating tool to build themes. This is great but unfortunately they tend to be limited in what they can do compared to a fully fledged programming language. Sure, they have basic support for conditionals and variables but I can guarantee there will come a time when your templating tool can't request or manipulate data in the way you want it to.

With headless you request your data via your plafroms API's, so you can decide exactly what you want to do with the data in your programming language of choice.

Most platforms have a traditional RESTful API but some offer more modern approaches such as GraphQL. Again it's all about customisation and having the ability to build your stores in the best possible way.

Scalability

When your store is decoupled from your platform, it allows you to host your front-facing website where ever you like.

This means you can not only control things like caching and content delivery, but you can replicate your store website across many servers giving you crazy reliability and redundancy.

It's also worth mentioning that new and exciting technologies like progressive web apps and AMP become infinitely more easier to implement on headless.

Finally, make it your own

Want to make a high performance react.js app with tiny bundles and smooth page loads? Well now you can, want to make a native mobile app with zero bloat and minimal dependencies? Well now you can!

Headless truly does rock and it takes the benefits of platforms like Shopify, BigCommerce and Magento and breaks of their shackles and limitations.

If you haven’t already, I highly recommended you look into headless commerce for better, faster experiences for your users.

Top comments (0)