💤Hibernate

Hibernate is a feature intended to speed up Saturn websites by skipping plugins that would otherwise not do anything the user needs on a specific page.

For example: if your plugin enchances the login page, why load it on every single page in Saturn? It's faster to hibernate the plugin than to load it, it also reduces the number of unintended bugs your plugin could cause.

What happens when my plugin hibernates?

For your plugin, nothing. No files will be loaded and nothing will be included. Your plugin will still appear in Saturn's list of plugins, but unless it's active it won't be loaded.

If your plugin hibernates in the official Control Panel plugin it will show as unloaded in the plugin list, and when clicked on it will inform the user that the plugin is hibernating.

How do I hibernate my plugin?

Simply edit the manifest file, and add a list of URLs you'd like your plugin to "wake up" on. When a user visits one of these URLs, the plugin will load. If the URL is not visited, the plugin will hibernate.

To disable Hibernate simply enter false:

"Hibernate": false

To enable Hibernate, enter an array list of URLs. This example plugin will wake up when a user visits example.com/login or example.com/register

The plugin will also wake up if a user visits sub-pages of the pages you listed, such as example.com/login/reset

"Hibernate": ["/login", "/register"]

Potential drawbacks

If your plugin is intended for use on the majority of Saturn, excluding one of two pages, it might not be worth enabling Hibernate.

Saturn uses loops to find Hibernate URLs, so if you have a lot of URLs, this may just slow down your plugin more.

Last updated