Results 1 to 4 of 4
Hybrid View
-
16th Sep 2012, 10:34 PM #1OPMemberWebsite's:
maxneeds.infoPHP vs AJAX requests and speed question..
Hi guys.
I am here with an interesting question.. I will try to explain briefly.
For example you have left,middle and right section in your website. Each of them must show content in different files on your server (for example 1.txt,2.txt and 3.txt).The txt files are 512kb each.
In my case i have to do an ajax request to a php file that gets and echoes (so the ajax can take the result ofc) the content from the txt files.
So should i do 3 ajax requests(for each section) to the php file or do just 1 ajax request and then split the result in 3 parts with some separator for example.
What would be faster ? What would save more CPU usage too?
ThanksPorsche_maniak Reviewed by Porsche_maniak on . PHP vs AJAX requests and speed question.. Hi guys. I am here with an interesting question.. I will try to explain briefly. For example you have left,middle and right section in your website. Each of them must show content in different files on your server (for example 1.txt,2.txt and 3.txt).The txt files are 512kb each. In my case i have to do an ajax request to a php file that gets and echoes (so the ajax can take the result ofc) the content from the txt files. So should i do 3 ajax requests(for each section) to the php file Rating: 5
-
17th Sep 2012, 12:05 PM #2Member
I'd say a single request would be definitely faster. CSS sprites are popular for the same reason - combining multiple requests into a single one.
And I don't think you have to worry about CPU usage for such a simple script.
-
17th Sep 2012, 05:59 PM #3OPMemberWebsite's:
maxneeds.info@deliteblogger this is just example. The script will be much more complicated.
The thing is that i can complicate it as much as i want (meaning to download more variable data and show it with single ajax request)
so i was wondering if i should not complicate it so much and just do more ajax requests instead.
-
23rd Sep 2012, 03:54 PM #4Member
Depending on the txt1,txt2, etc file size, i would say use 3 Ajax requests would be better than splitting the text...In terms of CPU usage. Might be wrong, but splitting heavy amounts of texts causes CPU usage to go up quite a bit. Or at least happened in my case, whereas when i used ajax requests didn't seem to be too bad.
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Question about VPS-speed
By Szabortusz in forum Hosting DiscussionReplies: 1Last Post: 28th Aug 2011, 06:58 AM -
Ajax googleapis
By killer123 in forum Webmaster DiscussionReplies: 2Last Post: 22nd Feb 2011, 11:35 AM -
Ajax Load
By Daniel in forum Useful SitesReplies: 5Last Post: 1st Jun 2010, 04:29 PM -
Help with CSS (and maybe PHP/MySQL/Ajax)
By Sefyu in forum General DiscussionReplies: 5Last Post: 8th Mar 2010, 10:54 PM -
AJAX IM
By bloodqman in forum Technical Help Desk SupportReplies: 0Last Post: 7th Dec 2009, 07:24 PM
themaLeecher - leech and manage...
Version 5.03 released. Open older version (or...