Welcome Guest, Not a member yet? Register   Sign In
.env file and performance
#3

(02-21-2021, 04:21 AM)kenjis Wrote: Codeignitter is also reading the .env file again and again per each request.

If you don't want to do it, remove .env file and set environment variables
with your web server.

Thanks for coming to my help kenjis!

I think you have not completely understood my point.
Let me expain it to you in detail..

lets suppose i have a variable values in .env

MAX_LOGIN_ATTEMPTS=5

in the process of returning response:
  • I read the MAX_LOGIN_ATTEMPTS in a controller filter before going to process the request
  • In the controller i read again MAX_LOGIN_ATTEMPTS for some other reason
so you can see i have read MAX_LOGIN_ATTEMPTS  twice for just one request.
(this can be more than twice in my project)

So is the code ignitter reading the .env file twice for above request ?
OR
is the codeigniter reads the .env file once in the beginning of the request and keep the variables in memory until response is served?
Reply


Messages In This Thread
.env file and performance - by ak.kavinda - 02-21-2021, 12:49 AM
RE: .env file and performance - by kenjis - 02-21-2021, 04:21 AM
RE: .env file and performance - by ak.kavinda - 02-21-2021, 10:29 AM
RE: .env file and performance - by kenjis - 02-21-2021, 04:13 PM
RE: .env file and performance - by iRedds - 02-21-2021, 04:26 PM



Theme © iAndrew 2016 - Forum software by © MyBB