Server is not responding when ajax request length is big wordpress

Viewed 46

I am facing a problem with ajax request to admin-ajax.php.

When request content length is less e.g 3000. server response is 200. it is working fine.

But when request content length is e.g. 300000. server response is 302. it is redirecting to another page without responding.

I don't know what is happening. I am on shared server. Can I do anything using cpanel?

Can anyone help me please?

thanks

1 Answers

You may try the following, that solves my problem. However, it's recommended that you use chunk data if you can like loading a specific number of data for a request.

Method 1: Put ini_set('max_execution_time', 300) top of your ajax file(300 seconds)

Method 2: Change server configuration/Edit php.ini

– upload_max_filesize = 265M
– post_max_size = 265M
– max_input_time = -1
– max_input_vars = 8000
– max_execution_time = 500
– Memory Limit = 512M
Related