Can Drupal be faster than Gatsby?

Events happening in the community are now at Drupal community events on www.drupal.org.
Posted by david jeyachandran on December 31, 2020 at 7:43pm

I'm working on a module (FasterWeb) that changes the frontend behavior of a Drupal site. We intelligently prefetch the HTML of the most likely links that a user will click on and these links open almost instantly (~ 100ms). The user experience is especially remarkable on mobile.

Do you know of any similar Drupal modules? Is there anyone interested in testing the module?

The module connects to a backend service that collects data on which pages users visit. Based on this historical data it's able to predict where a user is likely to click. If this proves successful, I hope at some point to charge for the backend service for businesses but keep it free for personal and Drupal community sites.

Currently there are limitations - it only works for anonymous users and it assumes that your Drupal site has Javascript implemented with Drupal behaviors. Thanks to Eduardo for help getting this module finished, especially for helping to solve issues with Drupal AJAX.

Here's a demo site - https://cravetime.com/ . The orange boxes (demo only) indicate prefetched links. Open the Chrome Inspector console to see what the code is doing.

Please let me know if you'd like to test the module. I'll post more info if you're interested.

Thanks
David

Demo site

Chrome Inspector console

AttachmentSize
cravetime.png 104.36 KB
inspector.png 76.91 KB

Comments

This is awesome. I have seen

Posted by edutrul on January 1, 2021 at 1:26am

This is awesome.
I have seen your demo on live and works like a charm.

CEO at heydru! / Senior Developer at Lullabot

This is awesome. I have seen

Posted by edutrul on January 1, 2021 at 1:26am

This is awesome.
I have seen your demo on live and works like a charm.

CEO at heydru! / Senior Developer at Lullabot

This is awesome. I have seen

Posted by edutrul on January 1, 2021 at 1:26am

This is awesome.
I have seen your demo on live and works like a charm.

CEO at heydru! / Senior Developer at Lullabot

Hi, this is a great

Posted by user654 on January 1, 2021 at 10:22am

Hi,
this is a great work.
There is another module that does the same,its called Quicklink
https://www.drupal.org/project/quicklink
Cheers

Why aren't more people using this?

Posted by david jeyachandran on January 1, 2021 at 2:33pm

Thank you @pinkonomy!

Quicklink seems like a fantastic module. Any idea why more people aren't using it?

In my particular use case in Latin America it's helpful to minimize the number of prefetches (and the data usage). The FasterWeb module will only prefetch the most likely links a user will click on (based on historial traffic).

Curious to hear why people think that this style of (prefetching) module is not used more since it makes such a huge difference to frontend performance.

Thanks again
David

Logic?

Posted by damienmckenna on January 2, 2021 at 9:16pm

How does FasterWeb determine the most likely paths that visitors would take from a specific page?

(edited)
For each path, we keep a running count of the number of times people click on a particular link path. This is stored in an external web service (NodeJS service). So when you open a page, a request is sent and the web service responds with the top pages that people have gone to.

So we use the book module, in one of our sites and FasterWeb has automatically prioritised the Forward, Back and Up links simply based on the running count.

Longer term and with more data I'd like to tweak the algorithm to prioritize learning from recent traffic over older traffic - important for sites for example where the front page links changes constantly. We were getting above a 70% cache hit rate so thought I'd leave these changes till later when we really need this.

Happy to help you do a quick test of the module if you're interested. It actually has made a difference in our organization. We ran an A/B test - half the users had the normal site and half with FasterWeb and we had an 8% increase in page views with FasterWeb, which was really significant for us.

David

Abstraction?

Posted by damienmckenna on January 4, 2021 at 7:43am

If you could segment off the API logic so that it could be swapped out for other services, like Google Analytics or the Statistics module, that could be really useful.

Are you intending to open source the custom logging service?

The FasterWeb API logic is already decoupled

Posted by david jeyachandran on January 4, 2021 at 8:38pm

The FasterWeb API logic is already decoupled from the frontend functionality. So it wouldn't be too difficult to swap out the backend. Google, for example, have a library called GuessJS (https://guess-js.github.io/) that uses Google Analytics data to predict which links a user will click on.

I had hoped one day to generate an income from custom logging service (plus prediction engine). At the moment it's really simple and open sourcing it is always an option.

that's very interesting. Have

Posted by alexmoreno on January 5, 2021 at 11:52am

that's very interesting. Have you considered joining efforts with quicklink, to expand the module/service instead of duplicating efforts? Just an idea

Joining efforts

Posted by david jeyachandran on January 5, 2021 at 8:10pm

HI Alex, Good idea! I'm just studying the Quicklink code and will get in touch with Mike Herchel, the module developer. I'm really impressed with his module code.

We're interested in testing it

Posted by Sequencing.com on January 4, 2021 at 7:19am

Hi David - This looks very promising and our team is interested in testing it with the part of our site that is still using Drupal 7. We also use the book module and will start there, such as https://sequencing.com/education-center and https://sequencing.com/knowledge-center

The other part of our site is in React that has been hyper-optimized for speed, such as https://sequencing.com/blog so our team is looking forward to testing this module and comparing the performance.

Thank you for creating this very interesting module - it looks like it has a lot of potential.

Please let us know how to access the FasterWeb module.

Great to connect with a team that are obsessed with speed. Well done with the Sequencing blog - I just checked and you have a perfect 100 Google Lighthouse score. Wow!

I'll finish off the Drupal 7 module and get it to you tomorrow or Wednesday. I'll send you a direct message. Look forward to working with you.

100 score

Posted by mikeytown2 on January 5, 2021 at 8:52am

Glad to see that both of you have discovered the secrets to advagg in order to get a perfect score. Well done!

Advagg - Great module!

Posted by david jeyachandran on January 6, 2021 at 2:16am

Advagg - Great module!

Repo link sent via direct message

Posted by david jeyachandran on January 6, 2021 at 2:08am

Hi Sequencing.com,

Just to let you know that this afternoon I sent a link via direct msg to the FasterWeb module repository. (It might be in your spam folder). I'm working to also get this on D.org but I might have a few conversations first to workout a roadmap to avoid duplication with module functionality.

Upload to d.o?

Posted by damienmckenna on January 5, 2021 at 6:37am

I suggest starting with uploading the module to d.o, that way you claim the namespace and can start receiving feedback & patch / merge requests.

It was important for me to

Posted by david jeyachandran on January 7, 2021 at 12:36am

It was important for me to gauge the interest level and to see what other similar modules existed. I'll try and chat with the developer of Quicklink too. I look forward to get this module uploaded to d.o.

High performance

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

AltStyle によって変換されたページ (->オリジナル) /