Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 817097
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T01:56:22+00:00 2026-05-15T01:56:22+00:00

This is a trick question, while developing a php+ajax application i felt into some

  • 0

This is a trick question, while developing a php+ajax application i felt into some long queries, nothing wrong with them, but they could be done in background.

I know that there’s a way to just send a reply to user while throwing the real processing to another process by exec(), however it dosen’t feels right for me, this might generate exploits and it’s not pratical on making it compatible with virtual servers and cross platform.

PHP offers the ob_* functions although they help on flushing the cache, but the user will keep connected until the script is running.

I’m wondering if there’s an alternate to exec to keep a script running after sending data to user and closing connection/thread with apache, or a less “dirty” way to have processing data sent to another script.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T01:56:22+00:00Added an answer on May 15, 2026 at 1:56 am

    After doing some research I’ve found 3 answers for this question:

    1. Do an ajax request with a low timeout value, once the timeout is reached JS will proceed to the next step while php, in background with ignore_user_abort enabled, will keep processing.

    2. Break apart slow processes from the script that directly answers to the user doing a immediate reply or partial reply (if possible, depending on the case), storing the slow process variables into a _SESSION or database, sending it to worker by cURL with low timeout value OR having a cron task to call workers.

    3. Use Gearman.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Following the CSS style trick from this question I was able to create a
Inspired by this question , I'd like to know whether there is any trick
(Unfortunately, this question is about a non-recommended practice. While I appreciate advise against doing
In this question I asked about NHibernate session lifetime. I'm using a desktop application,
This is related to this question I asked a while back. The end game
I am working on an intranet web application using PHP/MySQL. My question is about
Update 25/03/2011 I've marked this question as answered, while I don't yet have the
I've been trying for a while pack & unpack some chars into an integer.
i find this question tricky but what files store method signature info for xml
This is a slightly tricky question. I am using NSDateFormatter on the iPhone but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.