First recording & optimization
The process of optimizing your website's JavaScript with MageProxy is separated into two main steps. First, you need to create a recording of the JavaScript used on your website. Second, you need to create an optimization which will use the data collected by the recording.
Recording JavaScript
Our platform unobtrusively tracks the JavaScript files used across your site by real user traffic. While a recording is running, it captures which JavaScript files are loaded on every page your users visit, in real-time. You can stop and start a recording as many times as necessary.
Don't worry if you don't capture all dependencies on the first run. MageProxy has a built-in fallback: if a required JavaScript file isn't in one of our optimized bundles, it will simply be loaded from your server the old-fashioned way. These fallbacks are also recorded, so they can be included in the next optimization you create.
For continuous and automated optimization after this initial process, MageProxy provides an Auto Run feature, which automates the optimization process to run seamlessly in the background.
Why is recording necessary?
MageProxy needs to understand which JavaScript files are actually being used on your website. This ensures that only the necessary JavaScript is included when our service creates optimized bundles for your visitors.
How does MageProxy handle multi-store setups?
Every store view gets its own recording, ensuring that JavaScript files not used on a specific store (which might be using a different theme) are not bundled. This also means that every store view receives its own optimization.
Creating your first recording
Login to the Magento admin, choose System > Tools > mageproxy.io > Start New Recording
You can select how long you want the recording to run and which store views should be included. After the recording time has passed, the recording will stop automatically; selecting multiple store views will create separate recordings for each store view.
While the recording is running, you can visit your website. Try visiting various pages, e.g. Home Page, Category, Product page and Checkout. The more pages that are visited while the recording is active, the more complete the final optimization will be. You don't have to do it all yourself; the service is designed to record JavaScript usage from your real user traffic.
Creating your first optimization
After your first recording is stopped, either manually or automatically, you can create your first optimization. The default configuration should work for the majority of stores, so for our first optimization, we are just going to keep the defaults and create our optimization.
For more technical details on what happens during this step, see the Advanced Optimization Settings page.
While you are logged to the Magento admin, choose System > Tools > mageproxy.io > View (on the recording) > Create Optimization
Deploying your first optimization
Once your optimization is successfully built, you can deploy it. Deploying an optimization means that it will be served to your website's visitors.
While you are logged to the Magento admin, choose System > Tools > mageproxy.io > View (on the recording) > View (on the optimization) > Deploy
After deploying, it's a good idea to visit your website and verify that everything is working as expected. Check different pages, especially those with a lot of JavaScript functionality.
Reverting deployment
If you encounter any issues after deploying an optimization, you can easily revert to the previous state. Reverting a deployment will immediately stop the optimized bundles from being served, and your website will fall back to using the original, unoptimized JavaScript files.
To revert a deployment, navigate to the optimization details page and click on the "Revert" button.
System > Tools > mageproxy.io > View (on the recording) > View (on the optimization) > Revert
Reverting is a safe and quick way to handle any potential problems, giving you time to investigate the issue without affecting your users. You can then create a new recording and optimization to address the problem.