Boost for D7 saved thousands of Drupal users hundreds of dollars in hosting costs as large Drupal sites were served circumventing php, mysql and just serving them up as static HTML. I would say Boost was the essential performance god in D7.

https://www.drupal.org/project/boost

One could say that Varnish is better, but Varnish does not support https as per https://varnish-cache.org/docs/5.1/phk/ssl_again.html?highlight=https... Given Google now requires https, Varnish is a no no. https://www.theverge.com/2018/5/17/17365362/google-chrome-secure-indicat...

No one should expose Drupal to anonymous traffic given all the bots hitting dozens of times per second a website... Php / mysql based (expensive and heavy server utilisation) content editing should only be exposed to editors, while end users should get the high performance html only pages. Forms can be shown on non cached separate pages like the comment form (Drupal has built in feature for showing comment form on separate pages)

Just for reference, I hosted a 90 000 page Drupal site on a 25$ VPS with Boost and still do. The server load is around 1... The WP Counterpart of Boost has over 2 million installs... https://wordpress.org/plugins/wp-super-cache/

@wimleers ' assessment https://www.drupal.org/project/contrib_tracker/issues/2611322#comment-10...

Symfony already has a few static cache plugins
Some caching links

Comments

giorgio79 created an issue. See original summary.

giorgio79’s picture

Issue summary: View changes
sinasalek’s picture

Varnish needs much more resources comparing to boost and it is much more complicated to setup for end users. It is also overkill for most simple websites specially if they don't allow users to login. We used boost for almost all the websites we made and it made it possible to serve thousands of users a day using Drupal even on very cheap hosting services.
By porting it to core it becomes even easier to setup, just a tick in performance settings and suddenly you can have tons of visitors without having to be worried about server's capability

So great thumbs up for this

giorgio79’s picture

Issue summary: View changes
giorgio79’s picture

Issue summary: View changes
sinasalek’s picture

I found some working examples, some are psr7 and even psr6 compliant :
- https://github.com/JosephSilber/page-cache
- https://packagist.org/packages/sylweriusz/webcache-middleware
- https://github.com/clickalicious/caching-middleware
- https://github.com/zfegg/page-cache-middleware

Thanks for new PHP ecosystem and standards like psr6 psr7, great deal of what boost does is already available as separate components which greatly reduces the amount of code required for this feature

Another good this is Drupal 8 already support psr7 and psr6 :)

giorgio79’s picture

Issue summary: View changes
giorgio79’s picture

Issue summary: View changes
yannisc’s picture

Issue summary: View changes
giorgio79’s picture

Issue summary: View changes
nonom’s picture

Imho the Static HTML cache should be mandatory for big sites. No matters if they are using Varnish, Nginx or whatever.

cilefen’s picture

Many site admins love and use Boost, however, I do not understand the argument for this feature being in Drupal Core. I hope this idea is not only a result of frustration over Boost not being available yet for Drupal 8.

Even if there existed consensus that this idea is worth pursuing, there are roadblocks. There does not exist a Drupal 8/9 compatible version of Boost as of today. The 7.x version supports Apache fully but only semi-supports other web servers. Also, Boost would have to be made significantly easier to set up, on all web servers that Drupal Core supports.

So this is as of now just an idea. Does anyone have a practical plan for carrying this out?

pwolanin’s picture

Agreed with @cilefen that this does not seem like a feature that is appropriate for core since it would typically depends on details of how the webserver/hosting is set up to a degree that would make this very hard support and test as a core feature.

Seems like finding/funding maintainers would be a higher priority.

Also, I think some of the comments in this thread may be missing this point - if you are looking at an existing middleware that's not what boost does - the value is avoiding any Drupal / PHP code execution, as far as I understand, but looking for an on-disk file version before going to the index.php. The drupal core page cache is already more-or-less a solution if you are willing to accept a Drupal bootstrap cost.

geek-merlin’s picture

Just to break this down: If i get it right, D8 boost would be
- a sort of file backend for the page_cache module
- rewrite rules for major web servers to serve that pages without bootstrap
- invalidation logic for the files

And yes, that should mature in contrib.

giorgio79’s picture

Wow, I was losing hope for this thread :)
I just started playing with D8 the past week, and https://www.drupal.org/project/tome looks promising. I just had to rethink the site, eg instead of dynamic searches, I am creating Views indexes. Who searches in a site these days anyway, most everybody is using Google.

PS about the previous comments. Guys , no need for drupal php mysql bootstrap cost at all. Keep CMS content editing to auth users. Anonymous can have the page file cache.

geek-merlin’s picture

@giorgio79: Thanks for pointing to tome. So that does the yob for purley static sites, but not for static caching of only parts of the site.

nod_’s picture

Related (duplicate even?)

Wim Leers’s picture

Definitely related, but AFAICT not duplicate.

This issue is about keeping Drupal running as today, but basically improve the Page Cache module (which accelerates anonymous responses): avoid Drupal's involvement altogether and serve the page statically.

#3230448: Add a static generation tool to core AFAICT is about generating/exporting a static site, so that you do not have to deploy a working Drupal instance to your web server?

nod_’s picture

True, in my mind this issue would be a subset of the generation tool one. Because you could export the static pages for anon and keep classic drupal for auth users at the same time.

Wim Leers’s picture

👍

anoopjohn’s picture

As it stands, can the Drupal core page cache store the cached output as an html file (with some extensions / customization) in the filesystem and deliver it through htaccess magic?

sarathkm’s picture

We do have File Cache module which stores drupal cache on server disk space.

This though does not work as boost does but will be efficient enough with sites having large disk space for files and especially for small buget sites with adequate user traffic, where they have resource constrains like can't use or invest on Redis/Memcache with additional memory spaces e.g. shared hosting.

Chi’s picture

From my experience core Page Cache module gives almost same result. When cache hit happens it makes just one or two queries to the database backend. And if the backend is powered by Filecache or Memcache it won't establish DB connection at all. In such case the response TTFB would by 3-10 ms which is almost same as for static files.