It appears future came for us Magento developers in the end. Magento 2 platform is alive and kicking, and with it modern PHP tools like Composer entered our daily routine. And it's so much easier now the Composer is here to take care of my dependencies! Khm. Not so fast. To be honest, packaging software into neat fully decoupled packages is still a utopia. We model tightly coupled reality which is not something you can hide behind package manager. Nevertheless, there are some neat concepts behind Composer and Magento 2 working together, lets check it out.
Continue readingCategory Archives: Linux
Placing Magento 2 behind Varnish reverse proxy
Even though Magento 2 Admin clearly states that Built-In Application cache is not recommended for production use, most Magento stores I found through BuiltWith don't have Varnish configured yet. Additionally, I have the feeling that most Magento 2 developers do not have Varnish configured locally while developing. While Magento 2 page cache has been developed in a way that you should be able to transparently switch caching backends, this probably will not be the case in real life therefore getting to know idea of reverse proxy could come in handy.
Continue readingThe importance of network latency when scaling Magento horizontally
The sweet spot of any Magento project from hosting standpoint is when traffic patterns allow that all services store in question needs, fit on a single more or less powerful machine. Having that singe IP address you connect to in order to deploy code, do system upgrades when traffic is low and monitor when traffic is high is super convenient. But as store grows in terms of traffic, sooner or later you'll be forced to think horizontally. This usually means adding load balancer, couple of frontend nodes as well as dedicated servers for other services your store requires. In other words, you need more machines configured in private network working together in order to serve more traffic. There are many challenges to setting up and maintaining such system, with having fast network through which your nodes communicate being the most important component of your infrastructure.
Continue readingHole punching with Magento Enterprise Edition full page cache
In my last article on this topic I explained how Magento Enterprise Edition Full Page Cache works, and how to use performance boost it provides at your own controller action. In the second part of this mini article series, I will try to explain concept of Enterprise_PageCache containers used for allowing dynamic behavior for certain blocks, even though page is served from full page cache.
Continue readingHow to make specific WordPress posts visible only when accessed directly
Recently I had to to publish an article in a way that common site visitors aren't aware of it's existence. Basically this article had to be excluded from all WordPress loops and visible only when accessed directly. General idea of solution presented in this article is to use pre_get_posts hook to alter WP_Query. Goal is excluding hidden post on frontend, area that isn't single post and when area is single post other than hidden post it self. Now allow me to share code snippet that can be used for this purpose.
Continue reading