Skip to content

Lazy Start/Load Sessions #1543

Open
Open
@joshua-bn

Description

@joshua-bn

Description (*)

The session gets loaded/started in the controller but it might not ever need to be started. A lot of routes, like the category controller, don't have any need for the session. We can't be sure that they won't though, so we can't just use the FLAG_NO_START_SESSION flag to disable them on certain routes.

The block of code found in the following link is what needs to be placed elsewhere. Then, when the singleton is created, it can load that.

if (!$this->getFlag('', self::FLAG_NO_START_SESSION)) {

Expected behavior (*)

Sessions don't start/load until something tries to read a value from them or write to them.

Benefits

Potentially less session starting because we don't need to open sessions on all pages. This means less locking. Meaning potentially less waterfall issues in loading and thus faster pages.

Potentially less RAM used in the cache. This is especially prevalent for bots that don't go to pages that don't use the session.

Additional information

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions