2. Hello!
I am Chris Ozog
I am here because some people think that I love PHP and Drupal?!
You can find me at /krzysztofozog
2
3. Few words about me...
3
A Philosopher and A Developer… the worst thing is that I
have two master degree diplomas
More the developer than the philosopher:
❏ For more than decade I’m building Web Applications
❏ In 2004 I built my first App in PHP
❏ I’m addicted to clean code
❏ I’m Chief Technology Officer at Codesushi
❏ I love codereview...
4. Plan
▫ Headless approach -
explanation
▫ What was our plan
▫ What we did
▫ What went wrong
▫ Conclusions
4
5. Headless approach
❏ Drupal serves as backend
❏ REST api
❏ Website is coded in other
technology
❏ Frontend fetches data from
Drupal and displays content
properly
5
6. ❏ Possibility to use any other frontend
technology
❏ No need to conform to drupal
templates convention
❏ Can speed up development time
Headless approach - PROS
6
7. Headless
approach
- cons
7
❏ Drupal is reduced to content storage
❏ No out of the box drupal frontend features like
live edit
❏ No drupal frontend debug tools
❏ Can be confusing
8. What we planned
❏ To take a Drupal 8 for a spin
❏ Check validity of Headless approach
❏ Deploy it to Acquia*
For frontend we selected the silex framework and guzzle as http client
[*] - not our choice
8
9. 9
What we did
Frontend part
❏ Silex + Twig + Guzzle
❏ HTTP Cache
❏ HTML + CSS [obviously]
10. 10
What we did
Drupal side
❏ Install and configure drupal
❏ Enable REST API for drupal
❏ Write custom module, so all data needed for
rendering the page can be returned in one call
❏ Simple amendments to Drupal Admin UI like
preview
11. 11
What we did
Project layout
❏ All in one repo
❏ Frontend part in separate dir
❏ Regular drupal dir layout
❏ .htaccess - everything admin related goes to
drupal, everything else goes to frontend app
12. What went wrong
12
❏ Acquia
❏ Which is not that bad solution but …
❏ You have no control over the environment
❏ Support is not familiar with the headless concept
❏ They have really weird settings, that you cannot change
Note: we tested our solution on regular server - no issues at all
13. So what
actually went
wrong
13
Symptoms
❏ Page dies and only way to get it back is to restart whole
server, or issue a ticket for Acquia support to restart FPM
Cause
❏ Acquia has limit on amount of processes. We were calling
the app itself bumping this limit and causing app to crash.