I'm interested in implementing a very simple site using Magento 2 through its REST API alone. I have actually already done this with a client project and overall it went fairly well (though I ended up implementing a number of missing / not totally usable service endpoints), but my next implementation will be for my own personal site hosted on a very minimal / barebones server.

Because of this, I'm interested in getting as much performance out of Magento as possible, specifically in the application itself (in other words, outside of caching, redis, etc).

I'm wondering if there are techniques, modules, best practices, etc, that others have found that would remove a significant amount of overhead that might not be necessary in a headless implementation.

I suspect there may not be very many "easy wins" that are of any significance, but I imagine I'm not the first out there who is interested in using Magento 2 headless and who doesn't want any extra overhead being added by tasks that may not be relevant when only using the API.

1 Answer 1


Some things off to of my head.

  1. Disbale Modules. As far as optimizing the application itself, there' not much you can do IMHO, other than disabling any modules you are not using. For example if you're not using bundled product you can disable Magento_Bundle, Magento_BundleImportExport, Magento_BundleStaging (EE). Some of these may not give you any performance benefits, other than faster deployments, while others may stop their cron, observers and plugins from firing and you will gain some in performance.

  2. Limit Attribute Use. From the catalog perspective, use scaled down attribute sets so only attributes which are absolutely necessary are loaded. This applies to native attributes as well. Delete attributes you do not need.

  3. **Limit Caches. **If you're only using APIs, you will not need the page or block cache (either Varnish or Redis) so that will reduce your overall memory footprint. You will need Redis for the other caches or you can use the file system to gain on RAM usage with some potential performance impact. This is something you should be able to test.

  4. Filesystem Sessions. If you have a single server with fairly low number of active sessions you can use the filesystem for sessions which will further reduce your memory footprint by not using Redis.

  5. Use PHP7.

  6. Turn off logging.

  7. Admin Panel Logging. Turn off Admin Panel logging (or disable the module) with a risk of not knowing what is happening in you Admin, which comes in handy when you get hacked :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.