Google analytics suite is one of those datasets that are loaded with web data, ready to be harvested, crunched and in the end, benefit end-users to some extent. Our idea is this: Let’s use Google analytics data and predict which page users want to see next. And to make it more interesting to Mr. Asimov… let’s prefetch this predicted page into users browser so that the page loads blazingly fast. Enter… Neuralab’s Next WP Page preloader
In essence, we created a WordPress plugin which utilizes Google Analytics, visitor’s browser cache, and simple machine learning math to make user’s experience faster. Here are the simple steps to configure it on your website (you can download this plugin on our Github page: https://github.com/Neuralab/WP-next-web-page-cache )
To cache or not to cache
Initial step of this plugin is to obtain all the existing relationships (next visited from the current page) between web pages from the Google Analytics using WP CRON. For a setup details, please visit plugin’s settings page:
During that step, stochastic vectors and global popularity are calculated for each page. These data is utilized in predicting which pages have the most chances to be visited by the user from a current web page.
After initial step, first CRON function is deactivated and another activated which does the same but once per day and only updating local stats with the results from the past day. Also, predicting is activated – each time a user visits a web page, plugin will try to predict which pages will be next and fetch those web pages.
Note: Images from those prefetched pages will also be cached IF Cache API is available and the web app is running on HTTPS (which you should definitely enable).
We have a couple of future ideas for this automaton:
- lower cache limits for mobile networks
- cache all types of assets
- smarter cache clearing
You can write us about your thoughts via Github issues or you can visit us on 3rd WordPress meetup and talk to our dev team in person. The event starts on 31st of July (Zagreb) and here are all the details about it. This is a first version of this plugin and we would like to get your feedback on it.