kharkiv drupal tech talks #2
TRANSCRIPT
![Page 1: Kharkiv drupal tech talks #2](https://reader036.vdocuments.us/reader036/viewer/2022062902/58ee79991a28ab187d8b456d/html5/thumbnails/1.jpg)
Drupal Talks #2Kharkiv
![Page 2: Kharkiv drupal tech talks #2](https://reader036.vdocuments.us/reader036/viewer/2022062902/58ee79991a28ab187d8b456d/html5/thumbnails/2.jpg)
News
![Page 6: Kharkiv drupal tech talks #2](https://reader036.vdocuments.us/reader036/viewer/2022062902/58ee79991a28ab187d8b456d/html5/thumbnails/6.jpg)
https://dev.acquia.com/blog/review-github-pull-requests-with-ease/17/06/2016/10636
![Page 8: Kharkiv drupal tech talks #2](https://reader036.vdocuments.us/reader036/viewer/2022062902/58ee79991a28ab187d8b456d/html5/thumbnails/8.jpg)
http://slides.com/slavamerezhko/drupal-news-july-2016#/
![Page 9: Kharkiv drupal tech talks #2](https://reader036.vdocuments.us/reader036/viewer/2022062902/58ee79991a28ab187d8b456d/html5/thumbnails/9.jpg)
Caching in Drupal 8
![Page 10: Kharkiv drupal tech talks #2](https://reader036.vdocuments.us/reader036/viewer/2022062902/58ee79991a28ab187d8b456d/html5/thumbnails/10.jpg)
Reverse Proxy Cache (Varnish, Nginx, Akamai ...)
Internal Page Cache(anonymous)
Dynamic Page Cache(authenticated)
BigPipe
![Page 11: Kharkiv drupal tech talks #2](https://reader036.vdocuments.us/reader036/viewer/2022062902/58ee79991a28ab187d8b456d/html5/thumbnails/11.jpg)
Reverse Proxy Caching
![Page 12: Kharkiv drupal tech talks #2](https://reader036.vdocuments.us/reader036/viewer/2022062902/58ee79991a28ab187d8b456d/html5/thumbnails/12.jpg)
$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';
![Page 13: Kharkiv drupal tech talks #2](https://reader036.vdocuments.us/reader036/viewer/2022062902/58ee79991a28ab187d8b456d/html5/thumbnails/13.jpg)
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
![Page 14: Kharkiv drupal tech talks #2](https://reader036.vdocuments.us/reader036/viewer/2022062902/58ee79991a28ab187d8b456d/html5/thumbnails/14.jpg)
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
![Page 15: Kharkiv drupal tech talks #2](https://reader036.vdocuments.us/reader036/viewer/2022062902/58ee79991a28ab187d8b456d/html5/thumbnails/15.jpg)
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
![Page 16: Kharkiv drupal tech talks #2](https://reader036.vdocuments.us/reader036/viewer/2022062902/58ee79991a28ab187d8b456d/html5/thumbnails/16.jpg)
Internal page Caching
![Page 17: Kharkiv drupal tech talks #2](https://reader036.vdocuments.us/reader036/viewer/2022062902/58ee79991a28ab187d8b456d/html5/thumbnails/17.jpg)
Dynamic page Caching
![Page 18: Kharkiv drupal tech talks #2](https://reader036.vdocuments.us/reader036/viewer/2022062902/58ee79991a28ab187d8b456d/html5/thumbnails/18.jpg)
BigPipe
![Page 19: Kharkiv drupal tech talks #2](https://reader036.vdocuments.us/reader036/viewer/2022062902/58ee79991a28ab187d8b456d/html5/thumbnails/19.jpg)
Tips & TricksWebService request cachingFull object caching
![Page 20: Kharkiv drupal tech talks #2](https://reader036.vdocuments.us/reader036/viewer/2022062902/58ee79991a28ab187d8b456d/html5/thumbnails/20.jpg)
How to debug Drupal 8
![Page 21: Kharkiv drupal tech talks #2](https://reader036.vdocuments.us/reader036/viewer/2022062902/58ee79991a28ab187d8b456d/html5/thumbnails/21.jpg)
Tools
XDEBUG
IDE DEVEL DRUPAL CONSOLE
![Page 22: Kharkiv drupal tech talks #2](https://reader036.vdocuments.us/reader036/viewer/2022062902/58ee79991a28ab187d8b456d/html5/thumbnails/22.jpg)
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;
![Page 23: Kharkiv drupal tech talks #2](https://reader036.vdocuments.us/reader036/viewer/2022062902/58ee79991a28ab187d8b456d/html5/thumbnails/23.jpg)
/** * 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
![Page 24: Kharkiv drupal tech talks #2](https://reader036.vdocuments.us/reader036/viewer/2022062902/58ee79991a28ab187d8b456d/html5/thumbnails/24.jpg)
![Page 25: Kharkiv drupal tech talks #2](https://reader036.vdocuments.us/reader036/viewer/2022062902/58ee79991a28ab187d8b456d/html5/thumbnails/25.jpg)
Xdebug
https://confluence.jetbrains.com/display/PhpStorm/Zero-configuration+Web+Application+Debugging+with+Xdebug+and+PhpStorm
![Page 27: Kharkiv drupal tech talks #2](https://reader036.vdocuments.us/reader036/viewer/2022062902/58ee79991a28ab187d8b456d/html5/thumbnails/27.jpg)
XDebug Helper
https://chrome.google.com/webstore/detail/xdebug-helper/eadndfjplgieldjbigjakmdgkmoaaaoc
![Page 29: Kharkiv drupal tech talks #2](https://reader036.vdocuments.us/reader036/viewer/2022062902/58ee79991a28ab187d8b456d/html5/thumbnails/29.jpg)
![Page 30: Kharkiv drupal tech talks #2](https://reader036.vdocuments.us/reader036/viewer/2022062902/58ee79991a28ab187d8b456d/html5/thumbnails/30.jpg)
dump()
![Page 31: Kharkiv drupal tech talks #2](https://reader036.vdocuments.us/reader036/viewer/2022062902/58ee79991a28ab187d8b456d/html5/thumbnails/31.jpg)
Devel + Kint
https://www.webwash.net/drupal/how-print-variables-using-kint-drupal-8
![Page 32: Kharkiv drupal tech talks #2](https://reader036.vdocuments.us/reader036/viewer/2022062902/58ee79991a28ab187d8b456d/html5/thumbnails/32.jpg)
![Page 33: Kharkiv drupal tech talks #2](https://reader036.vdocuments.us/reader036/viewer/2022062902/58ee79991a28ab187d8b456d/html5/thumbnails/33.jpg)
Twig Xdebug( https://www.drupal.org/project/twig_xdebug )
![Page 34: Kharkiv drupal tech talks #2](https://reader036.vdocuments.us/reader036/viewer/2022062902/58ee79991a28ab187d8b456d/html5/thumbnails/34.jpg)
Drupal Talks #2Kharkiv