Jump to content

Recommended Posts

Posted

Hello, Im working on some randomizing scripts to display random data. I can either use a javascript with each line being one of the entries and randomly choose and display them or I can put the entries into mysal and selct random from a database.

 

Which is better for speed )which will slow the site down less).

Which creates less load on the server?

 

 

Also in general how many Mysql queries per page is it safe to have if you are concerned with page loading speed?

 

Thanks for any input

Posted

Don't know which would be faster but using javascript some users will not see the content you want to display if they have it turned off in their browser.

 

javascript would have less of a load on the server because it runs client side.

 

As for the number of querires, I had a problem on my site where it was generating over 5000+ queries and it still displayed the page in less than 5 seconds.

Posted

Thanks for the info

 

ok, so when you say 5000 queries do you mean 5000 mysql strings that do the query or do you mean query a databse with 5000 entries. Sorry Im new to Mysql...

 

I have 8 randomizing javascripts running and I want to put in 1 mysql query in place instead. That will amek the total queries on that one page equal to 7.

 

I guess I don't forsee a problem

Posted

5000 queries to the database. I had a bad plugin on my blog causing the problem. I only have 700 entries and 1500 comments but it queried the db 5000 times to get totals.

 

I did not write the plugin so I do not know why it was doing what it was doing.

Posted
Thanks a lot for the help. I will move forward building the mysql query

 

 

Just a follow up, I changed the javascript to mysql, and cut 4 seconds off my initially load time as alexa reports it. Deffinitely an improvement.

 

Thanks again

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...