Ajax controller responding slow |
I am experiencing that controller endpoint handling Ajax requests are responding very slow...
I've though mittigated this exit() just after handling the response to the client requesting the endpoint. Code: $this->output If I don't do the exit() in the controller function, it seems that too much is taking place in the post processing functions. Any better way to approach this? I am still on CI3!! Geir
Hi Geir,
using exit() isn't always the best practice, as it can sometimes lead to issues with things like session handling or hooks. A cleaner approach in CI3 is to make sure that any post-processing tasks are either optimized or moved to background jobs if possible. However, if you still need to stop the script execution, consider using return instead of exit(). Here's a quick example of how you can adapt your code: Code: $this->output |
Welcome Guest, Not a member yet? Register Sign In |