Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP page loads slowly and always needs to be refreshed before loading correctly.

Status
Not open for further replies.
Mar 23, 2015
37
US
I have a main user php page that has a lot of stuff going on. I return a lot of php data into a table that only shows 10 rows at a time using javascript. I also have an add new form under that. The issue that when opening that page I almost always get the data listed without the html and css being rendered in the browser and I have to refresh the page 2, 3 or sometimes 4 times before it renders correctly. How can I make that page load quicker and without needing to refresh all the time. This happens on various pcs using various browsers and I've also changed the css style sheets and that didn't make any difference. I'm listing the js page links at the bottom of the page too. Is it just the amount of data being returned? There are 2364 records in this particular table.

Thanks!
 
The first step to resolving this would be to run it through a HTML validation service.

This will expose quirks in the HTML that may be throwing your browsers for a loop.

You'd probably need to share a sample URL for anyone here to offer specific suggestions.
 
Without seeing the code that is rendering the page its very difficult to say. However if you are only showing 10 rows, why are you returning 2364?

There are ways to optimize data loading, but we would need to know your structure and page functionality to offer any specific advice.

But as a warning, this is not something you can just add a couple of lines of code to and have it work better. This is more likely a re-engineering of the page which will probably take some time.

Also since HTML is static it would probably be a good idea to post in forum434.







----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Web & Tech
 
Sorry guys I was busy with clients for the end of last week.

However if you are only showing 10 rows, why are you returning 2364?

The table shows 10 rows at a time with Next and Previous buttons. User can re-order the listing by any column header or sort by first letter of last name.

The user also wants me to add a Search name feature too. I'll be working on that today.

The first step to resolving this would be to run it through a HTML validation service.

Looks like I have some cleaning up according to the scan.

Thanks guys!
 
It seems like your page is (slowly) returning 2364 rows of hidden results, which your javascript then accesses to serve up ten rows at a time. That might not be the best way to do it.

Have you considered an AJAX approach - where your initial page load includes no data at all, and you use Javascript to request data as you need it?

You also might want to examine the database query (or whatever else it is) that populates the 2364 rows of results in the first place. Are there things you can do to speed that up?

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
Hi Chris,

You may be correct. On this particular page the data is a list of Donors and the last names are made to link to their Donation Details. There are a couple of thousand right now and that will only grow over time. Can you get me started on the ajax?

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top