Welcome Guest, Not a member yet? Register   Sign In
What is the correct way to load data from a databse once for use everywhere?
#5

(This post was last modified: 02-11-2023, 05:33 PM by kenjis.)

The session saves the data in session files (by default).
You can use the session data until the session expired/destroyed.
Each visitor will have their own session file.
So you should use Session for the data only for the visitor.

The Config (or any other) object is not saved, just in memory and you can share it with Factories only in one request.

You can save the object (if it can be serialized) with Cache.
https://codeigniter4.github.io/CodeIgnit...ching.html
Reply


Messages In This Thread
RE: What is the correct way to load data from a databse once for use everywhere? - by kenjis - 02-11-2023, 05:29 PM



Theme © iAndrew 2016 - Forum software by © MyBB