Deploying a Vue Store on Magento

Deliver a sub-second Vue website on Magento with Layer0

Vue is an open-source JavaScript framework for building single-page applications that has rapidly increased in popularity since its launch in 2014. This framework's primary draw is that it lets developers build fast, scaling JavaScript applications quickly. It’s lightweight and offers robust routing solutions for large applications. Vue offers great runtime performance and is fit to be the backbone for complex, revenue-generating websites with heavy traffic. The framework also offers the following benefits: built-in server-side rendering (SSR), tree shaking, bundling and virtual DOM.

Magento 2 is a popular eCommerce platform based on PHP7 and supports HTML5. Zend Framework 1 and 2 and MySQL Percona 5.6 or greater are a few of the frontend frameworks the platform supports, alongside its own proprietary frontend frameworks. Magento 2 offers rich, out-of-the-box features, customizations and third-party integrations.

Key features that help performance include:

  • NGINX: A web server that acts as a reverse proxy, HTTP cache, and load balancer.
  • Varnish: An HTTP accelerator designed for content-heavy dynamic web pages, such as eCommerce websites on Magento 2.
  • Composer: A tool for dependency management in PHP which can allow you to reuse third-party libraries without bundling with source code and reduce extension conflicts.
  • Symfony: A PHP web application framework for controlling the content, functionality, and look and feel of your online store.
  • Redis: An open source, in-memory data structure store used as a database, cache and message broker.

Despite the above, and the fact that Magento has a built in caching module, the platform does little to help vendors in terms of website speed. In fact, the platform leaves site speed optimization to its customers and their developers / implementors.

Regarding frontend compatibility, Magento 2 offers three proprietary frontends and robust APIs. Its frontends include: Base, Luma, and PWA Studio (available for M2.3 and up) and APIs include: REST, SOAP, and GraphQL. Bear in mind that PWA Studio and GraphQL are both only supported on Magento 2.3 or later. Furthermore, PWA Studio is geared specifically toward the platform, so you remain locked into its ecosystem. You can connect your own portable frontend or headless endpoints to the platform via the GraphQL API, however, customization of  Magento's code and/or database schema can disrupt API compatibility.  

Layer0 lets you deliver your Vue store on Magento and enjoy sub-second speeds. While Magento 1 is no longer supported by the platform, it is still compatible with the Layer0. The average website on Layer0 see median speeds of 320ms loads, as measured by Largest Contentful Paint (LCP). However, Layer0 is much more than a website accelerator. It is a Jamstack platform for eCommerce. Layer0 makes websites faster for users and simpler for frontend developers to maintain. The platform was built specifically for large-scale, database-driven websites such as eCommerce and Travel and included the following benefits: 

  • Jamstack for eCommerce via both pre and just-in-time rendering
  • Zero latency networking via prefetching of data from your product catalog APIs
  • An edge that can be configured natively in your Vue app (CDN-as-JavaScript)
  • Edge rules that can run locally, in pre-production and production environments  
  • Automated, full-stack preview URLs from GitHub, GitLab, or Bitbucket with every new branch and push
  • Performant split tests at the edge and A/B tests that do not slow down the site, canary deploys, and personalization
  • Serverless JavaScript that is much easier and more reliable than AWS Lambda

With Layer0, your Vue Magento store will run in sub-second speeds and your developers will be empowered to control edge caching and reduce rework using the various developer productivity tools that come with the platform.

Check out AKIRA, a Magento website on Layer0. AKIRA went from 6 seconds to sub-second page loads and saw mobile transactions double on Layer0. Universal Standard is another great example. This is a Vue store on Layer0, achieving sub-500ms page loads.

If you're currently using Vue, use the this guide to deploy your Vue application on Layer0 and get sub-second loads in as little as 1 hour of work. 

Deploy in minutes

Moovweb XDN works with all frontends
Deploy freeTakes 2 minutes