My “Week On StackExchange” Series takes a break at the moment because I don’t have not too much blog-worthy.
Instead, I’m starting something new again: Tips on a specific topic which you can read in 5 minutes maximum during coffee break. Mostly not by me, just found by me 🙂
I don’t try to make it a regular thing but I have a loose collection of useful stuff so why not use the blog to bring order into it and hopefully it’s also useful for others.
Let’s start with Magento Performance Tweaks, all with little effort and can be used without hesitation:
- Are you using saisonal designs? No? Then get rid of them:
@Fabian_ikono i always remove this feature. It causes a db query on each pageload.
— Daniel Niedergesäß (@sqlexception) 19. November 2015
How so? A rewrite of
Mage_Core_Model_Design::loadChange()
that does nothing instead. - And what about the “log” database tables of Magento, that track page views? No? They aren’t really useful anyways, especially with Varnish:
@Fabian_ikono @fschmengler Just disable the event observers that do the logging…
— Michael Türk (@drlrdsen) 29. September 2015
Here’s a Gist to copy and paste in your own app/etc/local.xml or module configuration.
- And a .htaccess snippet, so that requests to missing images do not turn into DDoS:
Simple, but very effective: (Magento wouldn’t know what to do with those anyway…) pic.twitter.com/TbXGdBuEL2
— Fabrizio Branca (@fbrnc) 23. August 2015
That’s it, coffee break is over. More coming soon!
Maybe also a good perfromance tip: Implement 404 not modified with TTL on `real` cms pages. And the rest implement with ETAG.
For example: http://mycustomergroup.mystore.nl/category/product will have a ETAG like {lookup-key} + {lookup-value}. If lookup key can be found and has lookup value, 404 not modified. You can lookup these keys in redish before starting the whole Magento thing. In Magento 1.9 you can use caching processor for that. Normally it takes about 150ms to return a page, now it only uses 12 ms to return 404 not modified.
Thanks for the tip! Just in case, anybody is confused: you mean “304”, not “404” 😉