Download - Kharkiv drupal tech talks #2
Drupal Talks #2Kharkiv
News
https://www.drupical.com/
http://stdclass.com/
https://habrahabr.ru/post/306504/
https://dev.acquia.com/blog/review-github-pull-requests-with-ease/17/06/2016/10636
https://github.com/facebook/PathPicker
http://slides.com/slavamerezhko/drupal-news-july-2016#/
Caching in Drupal 8
Reverse Proxy Cache (Varnish, Nginx, Akamai ...)
Internal Page Cache(anonymous)
Dynamic Page Cache(authenticated)
BigPipe
Reverse Proxy Caching
$settings['reverse_proxy'] = TRUE;
/*** Specify every reverse proxy IP address in your environment.* This setting is required if $settings['reverse_proxy'] is TRUE.*/$settings['reverse_proxy_addresses'] = array('127.0.0.1', ...);
/*** Set this value if your proxy server sends the client IP in a header* other than X-Forwarded-For.*/$settings['reverse_proxy_header'] = 'X_CLUSTER_CLIENT_IP';
For anonymous
Works from the box, need only to set "Page cache maximum age"
There is an example varnish VCL config in DrupalVM project:https://github.com/geerlingguy/drupal-vm/blob/master/provisioning/templates/drupalvm.vcl.j2
For authenticatedBy default D8 caching politics forbid caching pages in external
systems for Authenticated users:
This can be overriden by:overriding FinishResponseSubscriber;
overriding/extending CachingPolitics;
set a cookie-Cache-bin based on User roles onRequest;
update Varnish VCL to take cookie-Cache-bin into account;
$this->setResponseNotCacheable($response, $request);
https://www.drupal.org/sandbox/shumer/2554107
Cache Invalidation
Works perfect with invalidation by D8 cache tags
Contrib modules required:PURGE
PURGE_PURGER_HTTP
http://www.jeffgeerling.com/blog/2016/use-drupal-8-cache-tags-varnish-and-purge
Internal page Caching
Dynamic page Caching
BigPipe
Tips & TricksWebService request cachingFull object caching
How to debug Drupal 8
Tools
XDEBUG
IDE DEVEL DRUPAL CONSOLE
antiWSOD trick (settings.local.php)error_reporting(E_ALL);ini_set('display_errors', TRUE);ini_set('display_startup_errors', TRUE);
/*** Show all error messages, with backtrace information.*/$config['system.logging']['error_level'] = 'verbose';
/*** Disable CSS and JS aggregation.*/$config['system.performance']['css']['preprocess'] = FALSE;$config['system.performance']['js']['preprocess'] = FALSE;
/** * Use our local environment settings. */
if (file_exists(__DIR__ . '/settings.local.php')) { include __DIR__ . '/settings.local.php';}
/** * Use our local development services. */
$settings['container_yamls'][] = DRUPAL_ROOT . '/sites/development.services.yml';
https://www.drupal.org/node/2598914
Xdebug
https://confluence.jetbrains.com/display/PhpStorm/Zero-configuration+Web+Application+Debugging+with+Xdebug+and+PhpStorm
XDebug Helper
https://chrome.google.com/webstore/detail/xdebug-helper/eadndfjplgieldjbigjakmdgkmoaaaoc
Twig Debug( https://www.drupal.org/project/twig_xdebug )
dump()
Devel + Kint
https://www.webwash.net/drupal/how-print-variables-using-kint-drupal-8
Twig Xdebug( https://www.drupal.org/project/twig_xdebug )
Drupal Talks #2Kharkiv