Big changes are coming in D8 caching, and Symfony has its own http cache as well! Been wondering how this will affect Boost.

http://symfony.com/doc/current/book/http_cache.html
#1597696: Consider whether HttpCache offers any significant benefit over the existing page cache

Comments

mikeytown2’s picture

Reading it over and I think the caching layer operates in PHP; thus there is room for improvement. There might be 3rd party Symfony code that is similar to Boost. Researching this point is the first step.

I did something similar for the replacement of drupal_http_request()
https://groups.drupal.org/node/233173
I had httprl but guzzle was already out so we went with guzzle.

giorgio79’s picture

Hey Mikey,
Researched some more and found doctrine/commons which seems to be another great solution. More info here http://nerdpress.org/2012/07/10/caching-data-in-symfony2/

frob’s picture

Title: Boost and Drupal 8 » Time to start Boost for Drupal 8
Component: Caching logic » Installation
Category: support » feature

I think Boost could be completely awesome in Drupal 8. Specifically due to the services nature of Drupal 8. This is all theory to test the waters for the interest in developing this out further.

Boost could work as it does currently, (simplified) by generating static html that gets served instead of bootstrapping Drupal. Then atop that we could have a js script that would auto update the site with backbone.js accessing the data through the new Drupal services. This would allow static caching for logged in users.

Now is the time to start implementing this because this is awesome and patches that are awesome enough can still get in. Not saying that we should try and get boost into core, but instead saying that we might be able to simplify the installation process by building this out now.

Anonymous’s picture

Only mikeytown2 and bgm have write access to the repository for boost (AKAIK), I just provide support for the forum.

shivanshuag’s picture

Issue summary: View changes

I am interested to port the module to d8 as a part of Google Summer of Code. If you already plan to port the module to d8, I can still help

Anonymous’s picture

Feel free, no one was assigned and the last time I checked the documentation for the caching side of Symfony in D8 was so undefined that I couldn't work out how it was being implemented or whether boost had been negated. The major problems that you will face are caching pages with form data on them which would lead to data leakage.

shivanshuag’s picture

@Philip_Clarke Hi, I wanted to ask if you are willing to mentor the porting of this module under GSoC.

Anonymous’s picture

I think that https://www.drupal.org/user/282446 mikeytown2 , https://www.drupal.org/user/89461, bgm would be more appropriate. In that order for the most recent changes to the code base.

jackbravo’s picture

Now that we have a release date for Drupal 8 this is even more important.

Is anyone working on this? I would like to help =).

ksevta’s picture

drupal 8 still needs boost or dynamic_page_cache module in core is better than boost....

jackbravo’s picture

Boost is always better than any Drupal cache, because the web server sends the page without needing to use PHP to get the page from the cache.

mark_fullmer’s picture

I agree that, for people who can't use a memory-based caching solution (e.g., Varnish), a Boost-type approach will be a significant improvement over Drupal caching.

I have a working proof-of-concept for Boost-type caching for JSON rest data generated by Drupal 8 at https://www.drupal.org/sandbox/markfullmer/2655858. While I don't plan to expand this module to cover traditional pages, since I'm only using D8 as a backend, the implementation would be very similar; happy to discuss!

swim’s picture

Well here's an initial start on this, https://github.com/swim/boost

As others have mentioned this caching mechanism is really only useful when combined with appropriate web server configuration. Currently only a very basic nginx config has been provided and could be improved greatly, need to check for user session etc. Regardless of the current shortcomings I'm using this on varied hosting scenarios and it's rather effective - I'll share some WRK (HTTP benchmarking) results.

jithesh_drupal’s picture

hkirsman’s picture

Up!!! Love the work you're already done, swim!

swim’s picture

Thanks @hkirsman =),

I'll address your PR regarding server conf's ASAP. Going to provide an Apache one this weekend as well. Don't have any production servers with Apache tho; would be great if people could test. Theres some WRK brenchmarks in the readme.md,

595713 requests in 30.10s, 6.84GB read
Requests/sec: 19791.44
Transfer/sec: 232.74MB

Skipping PHP has it's gains xD.

hkirsman’s picture

I'd love to see the apache conf now :D Working on a project.

hkirsman’s picture

Any update on this? Still needing the apache conf! :)

DamienMcKenna’s picture

Title: Time to start Boost for Drupal 8 » Port Boost for Drupal 8
Component: Installation » Miscellaneous

Standardized the title.

ajayg’s picture

Any update on this?

pipicom’s picture

+1 Any update on this?

ANDiTKO’s picture

+ 1 for this. Boost is still effective for Drupal 8. Specially if you have a more static site or a shared hosting where nginx and varnish are not an option.

C-Logemann’s picture

I tested the code of #13 (Git repo of @swim) and this is a good start for the D8 cache integration. I will invest some time to improve and help to get this stable. But currently there is no server configuration helpers integrated as in D7.

Some thoughts and ideas about configuration helper:

When I look in D7 issues I see most problems with the configuration helper and not with the core functionality. It seems that many problems are related to different apache versions and in the D7 version there is no helper for nginx at all.
Because of the increasing complexity of different Apache versions and other webserver technologies I think it's not good to keep this helper functionality inside the main module. Maybe this can be handled inside an additional module. But I think it would also be possible to create an online helper for rewrite rules like the Mozilla SSL config generator. With this strategy we can keep the code lean, the port to D8 very fast, and the configuration helper side more flexible.

giorgio79’s picture

Proposed Boost for D8 core #2957610: Static HTML file caching in Drupal Core - Boost

Boost saved thousands of Drupal users hundreds of dollars in hosting costs.

And frankly, no one should expose Drupal (php/mysql) to the torrent of anonymous traffic on the net when they can serve up simple HTML.

C-Logemann’s picture

I just posted #2995040: Applying to be Maintainer and add this as related Issue.

@giorgio79 Because of so much arguments against Boost module with Varnish and other caching technologies and missing support for this module as contrib I believe it would be very hard to get this in core. Personally I currently don't see a reason to get this in core especially because of the new possibilities of Symfony. But in any case we need to get this run on Drupal 8 as a contrib module. Then we maybe get a chance for core like it was with views, media and so on.

swim’s picture

I'll provide an update on what I have done. The original work was completed in early 2016 and a lot has changed (3 years almost). Additionally, it was really a basic POC which was going to use stack middleware to handle the caching logic. However, alternative mechanism such as memcache and redis can retrieve cache entries faster than the file system can.

The only way this is worthwhile is to have the web server handle/ serve the cached response. Additionally, allowing dynamic data can be achieved via a reverse proxy making for an inexpensive D8 site.

I have totally rewritten my original implementation; which now uses a custom Guzzle client with Kevinrob\GuzzleCache and my own implementation of Cache\Adapter\Filesystem\FilesystemCachePool which is of course PSR6 compliant and plays nicely with Kevinrob\GuzzleCache\Storage\Psr6CacheStorage. The difference being with how we handle cache keys. Cache keys need to be reproducible by the web server. Cache keys derived from a filesystem path can potentially leverage a hierarchical strategy E.G. sites/default/files/cache/node/3 > |cache|node|:nid

hkirsman’s picture

I was curious to know if in D8 Boost would be able to detect what pages to update when for example node is being saved which is also shown on front page and news listing page?

swim’s picture

It certainly would; but that's simply piggybacking of cores cache tags.

effortDee’s picture

Any more updates?

pipicom’s picture

+1 This module is highly anticipated.

C-Logemann’s picture

I just was added as maintainer and will soon start my work on a D8 version in a lean concept as described in #23.

C-Logemann’s picture

Assigned: Unassigned » C-Logemann
joseph.olstad’s picture

@C_logemann , any progress on this?

Do you have a working apache config for the swim version of boost https://github.com/swim/boost?

  • C_Logemann committed 438a1b6 on 8.x-1.x
    Issue #2009898 by swim: Port Boost for Drupal 8
    
C-Logemann’s picture

Version: 7.x-1.x-dev » 8.x-1.x-dev
Component: Miscellaneous » Code
Status: Active » Fixed

@swim I decided to start with your initial port from #13. But I'm also interested in your additional work you mentioned in #26.

Because the initial port is already done I close this issue. We should open separate issues for improvements, bugs and feature requests of the D8 version.

joseph.olstad’s picture

Thanks C_Logemann, the boost module for D7 is great, good to see some movement for 8.x as well, can you please add a 8.x-1.x dev build on the project page?
also, could maybe tag an alpha release

C-Logemann’s picture

@joseph.olstad This was just the fist step to start with the code from swim. But after some tests functionally and technically I will do some corrections when needed regarding actual core and upcoming D9. The next step will be promoting the dev release on project page. And next we create a plan what is needed for alpha, beta releases.

joseph.olstad’s picture

Thanks!

C-Logemann’s picture

For people without git skills: The code can be downloaded via dev release page

joseph.olstad’s picture

@C_Logemann, if you have sufficient maintainer priviledges you can add a dev release to the project page , click this link:

https://www.drupal.org/node/89309/edit/releases

add a release for 8.x-1.x

after the project page cache expires it should show up on the project page.
?

C-Logemann’s picture

@joseph.olstad I know that and decided to wait with this until additional tests.

DamienMcKenna’s picture

It'd still be worth adding a dev snapshot as then you could enable automated tests. This would at least help make sure patches people upload can apply cleanly to the codebase, even though there aren't any actual tests yet.

C-Logemann’s picture

OK, I added dev release to project page and added tests.

@DamienMcKenna Thanks for the information about testing framework.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

nonom’s picture

The Apache configuration is probably not needed at all.

jsibley’s picture

Hi. Is this still moving forward for D8? Thanks.

aiphes’s picture

Hello
is there any news about the D8 version ?
Thanks

pipicom’s picture

Hello people!
Awaiting for the stable D8 version 🧐

localnetwork’s picture

Looking forward for a stable version.

joseph.olstad’s picture

@C_Logemann, any chance for an alpha tagged release?

Has anyone had any success with the dev version of boost (8.x-1.x)?

has anyone forked this project with any success?

C-Logemann’s picture

@joseph.olstad

any chance for an alpha tagged release?

In meaning of just tagging the current code:
No. Because we currently only have some code which the original author of the port even like anymore.

In meaning of pushing this module to something I like to tag as ready code for usage:
I think there is a good chance to move on this year from my side and time I can contribute. But unless we don't get more support of other contributors I will focus only a light version of this module without any server configuration help (.htaccess snipit generator). Because my company currently focus on Nginx it will even not easy for me to help with testing of Apache (.htaccess) and cannot give any support on this.

Has anyone had any success with the dev version of boost (8.x-1.x)?

This question is the best argument against just tagging the code.

has anyone forked this project with any success?

From the current state of contributions for this module I would even welcome forks of this project if this is the only way to get contributions I can backport.

joseph.olstad’s picture

I don't see why we can't support .htaccess, as it's already working nicely in boost 7.x (especially when using the best RTBC patches with 7.x)

can't we just upgrade those forms and code?

have you tried drupalmoduleupgrader ?

it's got some newer releases lately, might be worthwhile taking the latest dev of boost 7.x (with the best rtbc patches applied) and making another 8.x branch from that using drupalmoduleupgrader at least to get a head start.

otherwise we'll end up with forked versions of boost 8.x , one for nginx and another for apache.

In fact, there's also quite a few RTBC patches that should be brought into 7.x before running drupalmoduleupgrader

no sense upgrading bugs into 8.x

I'd rather see the best RTBC patches going into current head of 7.x THEN run drupalmoduleupgrader

Maybe you should add me as maintainer so that I can work on this.

joseph.olstad’s picture

so my approach would be:
take 7.x boost, latest dev, add the most reputable rtbc patches to it

then run drupalmoduleupgrader on that and doctor that up, test it.

this will get most of the best possible code to start with in Drupal 8.

seeing as the current 8.x branch is stale, likely has a lot of unnecessary bugs and perhaps stripped down functionality, make a new branch

liberatr’s picture

For anyone who ends up at this issue wondering about a static solution for D8/9/10: https://www.drupal.org/project/tome
I realize it is a pretty different use-case to Boost, but anyone looking at this problem space in the modern era is probably also wondering about static site generators.

joseph.olstad’s picture

ya I noticed that one, pretty cool, however boost imho, is still a pretty awesome solution that is missing from D9/D10.

Boost in D7 is very cool, would be nice. I spoke with MikeyTown2 a while ago, he was the main mastermind behind Boost, this project is seeking
new maintainers btw.

C-Logemann’s picture

Assigned: C-Logemann » Unassigned

We are moving forward to a stable boost D9 module with core functionality as I just added code from #3214814: Drupal 8/9 readiness, pages configuration, purge and generate caches.

If somebody wants to contribute code with an Apache config helper e.g. based on old D7 code and maybe created with the "drupalmoduleupgrader" module I'm open to accept patches or better Merge Requests if this is placed in a sub module. But as described above I will concentrate on core functionality which based on the code provided by @swim and extended by @abhaisasidharan and myself with some configuration options.

And everybody who like Apache configuration options can primary start to help with all the Apache related issues in this module which are not related to core functionality or only related to configuration helper.

ressa’s picture

Sounds great @C-Logemann, thanks.

@liberatr I agree that Tome is relevant to mention here. I just tried Bookish, which is an install profiles show casing Tome, and I was extremely impressed. Bookish is quite easy to get started with, and experience how Tome works:

Bookish is similar to core’s standard profile, but every feature has been tweaked to provide the best out of the box experience possible.