Magento Tutorials

How to Optimize Resource Files in Magento 2

Hello Magento Friends,

Today I am going to explain optimizing resource files of your Magento 2 store.

As you optimize website content and images, it is equally important to optimize the resource files. Let’s understand it deeply.

Ways to Optimize Resource Files in Magento 2:

Optimizing resource files means decreasing the load time of resource files. There are three ways you can optimize the resource files in Magento 2:

  • Merging Files – It will combine files of the same type into a single file.
  • Bundling Files – It will make a group of separate files in order to reduce HTTP requests.
  • Minifying Code – Code minification will remove spaces, line breaks, and comments.

Default Magento does not merge, bundle, or minify files. You can perform these actions using the below steps.

Steps to Optimize Resource Files in Magento 2:

Step 1: General Configuration

  • From the Admin Panel, go to Stores > Settings > Configuration.
  • Now, from the left-hand side menu panel, expand the ADVANCED option and select Developer.

Step 2: Optimize CSS Files

  • Expand the CSS Settings.
  • Now set Merge CSS Files and Minify CSS Files fields to Yes.

Step 3: Optimize JS Files

  • Expand the JavaScript Settings.
  • Now set Merge JavaScript Files and Minify JavaScript Files fields to Yes.

Step 4: Optimize PHTML Files

  • Expand the Template Settings.
  • Then set the Minify Html field to Yes.

When completed, click the Save Config button.

Final Say:

Using the above steps, you can optimize resource files in Magento 2 and speed up the page loading. Check out more ways to improve the speed of the Magento 2 store. Share the article with Magento merchants and stay updated for more tutorials on Magento 2.

Happy Reading!

Click to rate this post!
[Total: 3 Average: 5]
Gaurav Jain

Gaurav Jain is Co-Founder and Adobe Certified Expert-Magento Commerce Business Practitioner. Being Computer Engineer👨‍💻 and possessing Extensive Marketing skills he handles all kinds of customer Queries and his Happy😀 & Helping🙏 Nature makes customer's day Delightful. When he isn’t working, you’ll find Gaurav Reading on Books📖 or Traveling🚗. Also, he is Speaker at Magento Meetups.

Recent Posts

How to Integrate ChatGPT with Laravel Application?

In this guide, we'll explore how to integrate ChatGPT, an AI-powered chatbot, with a Laravel…

2 days ago

What are Net Sales? How to Calculate Your Net Sales?

In the world of business, understanding financial metrics is crucial for making informed decisions and…

4 days ago

Magento 2 Extensions Digest April 2024 (New Release & Updates)

Welcome to the MageComp Monthly Digest, where we bring you the latest updates, releases, and…

4 days ago

The ABCs of Geofencing: Definition, Features and Uses

In this era, businesses are always on the lookout for ways to engage with their…

5 days ago

How to Delete Product Variant in a Shopify Remix App using GraphQL Mutations?

Managing a Shopify store efficiently involves keeping your product catalog organized. This includes removing outdated…

6 days ago

6 Innovative Tools Revolutionizing E-Commerce Operations

E-commerce has transformed the way consumers shop for products and services and interact with businesses.…

1 week ago