{"id":13,"date":"2017-08-01T06:27:43","date_gmt":"2017-08-01T06:27:43","guid":{"rendered":"http:\/\/langelov.com\/?p=13"},"modified":"2017-08-01T23:12:21","modified_gmt":"2017-08-01T20:12:21","slug":"zend-framework-2-performance-optimization","status":"publish","type":"post","link":"https:\/\/lyubomir-angelov.com\/blog\/zend-framework-2-performance-optimization\/","title":{"rendered":"Zend Framework 2: performance optimization"},"content":{"rendered":"<p>Nowadays the performance of a website is very very important for everything, user experience, Google\u00a0and so on.<\/p>\n<p>I have found nice PDF from one PHP conference in 2014 by Gary Hockin, this guy is Zend Framework contributor and made these awesome instructions how to optimize our Zend Framework 2 and how to use best practices.<\/p>\n<p><!--more--><\/p>\n<p>This is the file\u00a0<a href=\"\/wp-content\/uploads\/Maximising_Performance_in_ZF2_-_PHPUK.pdf\" target=\"_blank\" rel=\"noopener\">Maximising Performance in Zend Framework 2<\/a><\/p>\n<p>Some additions from me:<\/p>\n<ul>\n<li>Siege &#8211; how to measure your performance.\n<ul>\n<li>In addition, you can read this nice article about\u00a0<a href=\"https:\/\/www.sitepoint.com\/web-app-performance-testing-siege-plan-test-learn\/\" target=\"_blank\" rel=\"noopener\">Web App Performance Testing with Siege<\/a><\/li>\n<\/ul>\n<\/li>\n<li>Xdebug\n<ul>\n<li>Again nice article for it\u00a0<a href=\"https:\/\/www.sitepoint.com\/getting-know-love-xdebug\/\" target=\"_blank\" rel=\"noopener\">Getting to Know and Love Xdebug<\/a><\/li>\n<\/ul>\n<\/li>\n<li>View template map &amp; Classmaps\n<ul>\n<li>For this, I have made simple deploy.sh bash script to do several things, one of them is to generate the template map\n<pre><code class=\"language-bash\">#!\/usr\/bin\/env bash\n\n# Defaults\nprojectRootDir=$(pwd)\nGREEN=&#039;\\033[0;32m&#039;\nNOCOLOR=&#039;\\033[0m&#039;\n\n# Go to each module folder and execute template_map and classmap generators\nfor i in $(ls -d module\/*\/); do\n # Exclude our base module\n if [ $i == &quot;module\/Base\/&quot; ]; then\n continue\n fi\n\n # Go to module directory\n cd ${i%%\/};\n # Generate the template map and class map running PHP scripts\n printf ${GREEN}\n php ..\/..\/vendor\/zendframework\/zendframework\/bin\/classmap_generator.php -w\n php ..\/..\/vendor\/zendframework\/zendframework\/bin\/templatemap_generator.php -w\n echo &quot;---&quot;\n printf ${NOCOLOR}\n # Back to Root dir\n cd $projectRootDir;\ndone\n\n# Do your other stuff, run migrations, clear cache, composer update etc.<\/code><\/pre>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>That&#8217;s it, if you have any comments, your own ideas for optimizations or anything else, please write in the comments.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Nowadays the performance of a website is very very important for everything, user experience, Google\u00a0and so on. I have found nice PDF from one PHP conference in 2014 by Gary Hockin, this guy is Zend Framework contributor and made these awesome instructions how to optimize our Zend Framework 2 and how to use best practices.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[6,8,7],"class_list":["post-13","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-bash","tag-performance","tag-zf2"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Zend Framework 2: performance optimization - Lyubomir Angelov<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/lyubomir-angelov.com\/blog\/zend-framework-2-performance-optimization\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Zend Framework 2: performance optimization - Lyubomir Angelov\" \/>\n<meta property=\"og:description\" content=\"Nowadays the performance of a website is very very important for everything, user experience, Google\u00a0and so on. I have found nice PDF from one PHP conference in 2014 by Gary Hockin, this guy is Zend Framework contributor and made these awesome instructions how to optimize our Zend Framework 2 and how to use best practices.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/lyubomir-angelov.com\/blog\/zend-framework-2-performance-optimization\/\" \/>\n<meta property=\"og:site_name\" content=\"Lyubomir Angelov\" \/>\n<meta property=\"article:published_time\" content=\"2017-08-01T06:27:43+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-08-01T20:12:21+00:00\" \/>\n<meta name=\"author\" content=\"Lyubomir\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@angelovcode\" \/>\n<meta name=\"twitter:site\" content=\"@angelovcode\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Lyubomir\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/lyubomir-angelov.com\/blog\/zend-framework-2-performance-optimization\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/lyubomir-angelov.com\/blog\/zend-framework-2-performance-optimization\/\"},\"author\":{\"name\":\"Lyubomir\",\"@id\":\"https:\/\/lyubomir-angelov.com\/blog\/#\/schema\/person\/5e091f5c2fa79f57d30d482a7ef8cd92\"},\"headline\":\"Zend Framework 2: performance optimization\",\"datePublished\":\"2017-08-01T06:27:43+00:00\",\"dateModified\":\"2017-08-01T20:12:21+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/lyubomir-angelov.com\/blog\/zend-framework-2-performance-optimization\/\"},\"wordCount\":154,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/lyubomir-angelov.com\/blog\/#\/schema\/person\/5e091f5c2fa79f57d30d482a7ef8cd92\"},\"keywords\":[\"bash\",\"performance\",\"zf2\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/lyubomir-angelov.com\/blog\/zend-framework-2-performance-optimization\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/lyubomir-angelov.com\/blog\/zend-framework-2-performance-optimization\/\",\"url\":\"https:\/\/lyubomir-angelov.com\/blog\/zend-framework-2-performance-optimization\/\",\"name\":\"Zend Framework 2: performance optimization - Lyubomir Angelov\",\"isPartOf\":{\"@id\":\"https:\/\/lyubomir-angelov.com\/blog\/#website\"},\"datePublished\":\"2017-08-01T06:27:43+00:00\",\"dateModified\":\"2017-08-01T20:12:21+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/lyubomir-angelov.com\/blog\/zend-framework-2-performance-optimization\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/lyubomir-angelov.com\/blog\/zend-framework-2-performance-optimization\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/lyubomir-angelov.com\/blog\/zend-framework-2-performance-optimization\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/lyubomir-angelov.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Zend Framework 2: performance optimization\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/lyubomir-angelov.com\/blog\/#website\",\"url\":\"https:\/\/lyubomir-angelov.com\/blog\/\",\"name\":\"Lyubomir Angelov\",\"description\":\"The life of a Manager\",\"publisher\":{\"@id\":\"https:\/\/lyubomir-angelov.com\/blog\/#\/schema\/person\/5e091f5c2fa79f57d30d482a7ef8cd92\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/lyubomir-angelov.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/lyubomir-angelov.com\/blog\/#\/schema\/person\/5e091f5c2fa79f57d30d482a7ef8cd92\",\"name\":\"Lyubomir\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/lyubomir-angelov.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/f6b8c15868355fa857fad18647aeadd07814e3d9baa72a1c92e718056684fec7?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/f6b8c15868355fa857fad18647aeadd07814e3d9baa72a1c92e718056684fec7?s=96&d=mm&r=g\",\"caption\":\"Lyubomir\"},\"logo\":{\"@id\":\"https:\/\/lyubomir-angelov.com\/blog\/#\/schema\/person\/image\/\"},\"sameAs\":[\"https:\/\/twitter.com\/angelovcode\"],\"url\":\"https:\/\/lyubomir-angelov.com\/blog\/author\/superfly\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Zend Framework 2: performance optimization - Lyubomir Angelov","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/lyubomir-angelov.com\/blog\/zend-framework-2-performance-optimization\/","og_locale":"en_US","og_type":"article","og_title":"Zend Framework 2: performance optimization - Lyubomir Angelov","og_description":"Nowadays the performance of a website is very very important for everything, user experience, Google\u00a0and so on. I have found nice PDF from one PHP conference in 2014 by Gary Hockin, this guy is Zend Framework contributor and made these awesome instructions how to optimize our Zend Framework 2 and how to use best practices.","og_url":"https:\/\/lyubomir-angelov.com\/blog\/zend-framework-2-performance-optimization\/","og_site_name":"Lyubomir Angelov","article_published_time":"2017-08-01T06:27:43+00:00","article_modified_time":"2017-08-01T20:12:21+00:00","author":"Lyubomir","twitter_card":"summary_large_image","twitter_creator":"@angelovcode","twitter_site":"@angelovcode","twitter_misc":{"Written by":"Lyubomir","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/lyubomir-angelov.com\/blog\/zend-framework-2-performance-optimization\/#article","isPartOf":{"@id":"https:\/\/lyubomir-angelov.com\/blog\/zend-framework-2-performance-optimization\/"},"author":{"name":"Lyubomir","@id":"https:\/\/lyubomir-angelov.com\/blog\/#\/schema\/person\/5e091f5c2fa79f57d30d482a7ef8cd92"},"headline":"Zend Framework 2: performance optimization","datePublished":"2017-08-01T06:27:43+00:00","dateModified":"2017-08-01T20:12:21+00:00","mainEntityOfPage":{"@id":"https:\/\/lyubomir-angelov.com\/blog\/zend-framework-2-performance-optimization\/"},"wordCount":154,"commentCount":0,"publisher":{"@id":"https:\/\/lyubomir-angelov.com\/blog\/#\/schema\/person\/5e091f5c2fa79f57d30d482a7ef8cd92"},"keywords":["bash","performance","zf2"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/lyubomir-angelov.com\/blog\/zend-framework-2-performance-optimization\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/lyubomir-angelov.com\/blog\/zend-framework-2-performance-optimization\/","url":"https:\/\/lyubomir-angelov.com\/blog\/zend-framework-2-performance-optimization\/","name":"Zend Framework 2: performance optimization - Lyubomir Angelov","isPartOf":{"@id":"https:\/\/lyubomir-angelov.com\/blog\/#website"},"datePublished":"2017-08-01T06:27:43+00:00","dateModified":"2017-08-01T20:12:21+00:00","breadcrumb":{"@id":"https:\/\/lyubomir-angelov.com\/blog\/zend-framework-2-performance-optimization\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/lyubomir-angelov.com\/blog\/zend-framework-2-performance-optimization\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/lyubomir-angelov.com\/blog\/zend-framework-2-performance-optimization\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/lyubomir-angelov.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Zend Framework 2: performance optimization"}]},{"@type":"WebSite","@id":"https:\/\/lyubomir-angelov.com\/blog\/#website","url":"https:\/\/lyubomir-angelov.com\/blog\/","name":"Lyubomir Angelov","description":"The life of a Manager","publisher":{"@id":"https:\/\/lyubomir-angelov.com\/blog\/#\/schema\/person\/5e091f5c2fa79f57d30d482a7ef8cd92"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/lyubomir-angelov.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/lyubomir-angelov.com\/blog\/#\/schema\/person\/5e091f5c2fa79f57d30d482a7ef8cd92","name":"Lyubomir","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/lyubomir-angelov.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/f6b8c15868355fa857fad18647aeadd07814e3d9baa72a1c92e718056684fec7?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f6b8c15868355fa857fad18647aeadd07814e3d9baa72a1c92e718056684fec7?s=96&d=mm&r=g","caption":"Lyubomir"},"logo":{"@id":"https:\/\/lyubomir-angelov.com\/blog\/#\/schema\/person\/image\/"},"sameAs":["https:\/\/twitter.com\/angelovcode"],"url":"https:\/\/lyubomir-angelov.com\/blog\/author\/superfly\/"}]}},"_links":{"self":[{"href":"https:\/\/lyubomir-angelov.com\/blog\/wp-json\/wp\/v2\/posts\/13","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lyubomir-angelov.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lyubomir-angelov.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lyubomir-angelov.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lyubomir-angelov.com\/blog\/wp-json\/wp\/v2\/comments?post=13"}],"version-history":[{"count":3,"href":"https:\/\/lyubomir-angelov.com\/blog\/wp-json\/wp\/v2\/posts\/13\/revisions"}],"predecessor-version":[{"id":29,"href":"https:\/\/lyubomir-angelov.com\/blog\/wp-json\/wp\/v2\/posts\/13\/revisions\/29"}],"wp:attachment":[{"href":"https:\/\/lyubomir-angelov.com\/blog\/wp-json\/wp\/v2\/media?parent=13"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lyubomir-angelov.com\/blog\/wp-json\/wp\/v2\/categories?post=13"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lyubomir-angelov.com\/blog\/wp-json\/wp\/v2\/tags?post=13"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}