[solved] Delay in ajax response time |
Hi When I click on my approve button it sends a confirmation letter to the user and adds the members information to the main members table from the members temp table.
Every thing works fine but the email is causing about a 10 second delay for my ajax. Once the accout approve it refreshes the div but takes 10 second to refresh because of email library. How to make that it faster. Code: <script type="text/javascript"> PHP Code: public function approve_member_login() {
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!
You could default your status to 1 in your table and instead of building
a new insert_data array pass the database method the newmembers_info array, it's already built. That should help a little on the speed. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
Thanks all I have a idea or two now will let you all know later what I have done
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!
(10-22-2017, 03:22 AM)InsiteFX Wrote: You could default your status to 1 in your table and instead of building I tried that now sill a few seconds delay. PHP Code: public function approved() { Code: $(document).ready(function() {
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!
10-22-2017, 11:02 PM
(This post was last modified: 10-22-2017, 11:03 PM by skunkbad. Edit Reason: note regarding frequency of cron )
I use a mail queue for all my websites. It's really an essential thing. As long as you have access to cron:
1) Instead of sending the email, put it in a database table with one field "sent" set to 0; 2) Use cron to check for email that hasn't been sent, send it, then update the "sent" field to 1; (I have cron check for unsent email once per minute) This type of behavior has a lot of advantages. For one, you can always check if mail is going out. Also, it's really easy to resend email just by marking "sent" as 0 again. There is 0 email sending lag time, because it's being put in a queue.
(10-22-2017, 11:02 PM)skunkbad Wrote: I use a mail queue for all my websites. It's really an essential thing. As long as you have access to cron: Not sure how to use cron at all.
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!
You could try this also using pure PHP.
PHP Code: // Instead of this What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(10-23-2017, 08:52 AM)InsiteFX Wrote: You could try this also using pure PHP. Its the email send() that delays it.
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!
(10-22-2017, 11:28 PM)wolfgang1983 Wrote:(10-22-2017, 11:02 PM)skunkbad Wrote: I use a mail queue for all my websites. It's really an essential thing. As long as you have access to cron: Everyone has to learn sometime: https://www.educba.com/linux-crontab/ |
Welcome Guest, Not a member yet? Register Sign In |