![]() |
Page loads super duper slow [resolved] - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Page loads super duper slow [resolved] (/showthread.php?tid=11853) |
Page loads super duper slow [resolved] - El Forum - 09-25-2008 [eluser]tinawina[/eluser] I have a clog up in my app (attached). It's a weird situation because if I clear my cache in Firefox and then pull up our homepage (which assembles a list of all articles availabe to browse) everything works great -- peppy page load. Then I'll do a keyword search, or I'll browse by just one variable, and after three or four of these types of searches everything clogs up again and takes forever to load the page. We have articles on our site that can be included in a search or browse list only if they meet about 4 criteria. So what we do is get the universe of articles that *potentially* meet the criteria and then run those articles through some if/else statements to determine which articles absolutely should be returned in a result list. Right now we only have 30 articles that we are testing with. And like I say, the page load time is fast after a browser cache dump but then is super slow - sometimes many minutes - after just a few times pulling up the result page. I thought I'd made headway with this problem when I added a couple of meta-tags to our page (in the standard head portion of the doc, and added a head portion to the area between </body> and </html> (found that tip on the net) like so: Code: <meta http-equiv="Pragma" content="no-cache"> But I'm back to the same behavior after playing with this for maybe twenty minutes. Any ideas about why this would work fine at first, and then degrade into glacial pace page returns? My controller is attached (unfortunately as a PDF file because I kept getting a file-type not allowed using other types). Appreciate any advice! Page loads super duper slow [resolved] - El Forum - 09-25-2008 [eluser]meridimus[/eluser] Have you tried using the built in cache function with CI? Code: $this->output->cache(1); It sounds like your server has a memory leak, could be an old version of PHP or MySQL? Page loads super duper slow [resolved] - El Forum - 09-26-2008 [eluser]tinawina[/eluser] I don't think it's the PHP or MySQL. The versions we have access to are PHP 5.0.45 and MySQL 5.0.45. I did look at the cache function. Can I ask - how would you use that in this situation? I don't get how cacheing works. I have tried it before and did get a file to save in a directory, etc. But How would I get that to work with my app? Excuse my ignorance! Appreciate any help! Thanks! Page loads super duper slow [resolved] - El Forum - 09-26-2008 [eluser]tinawina[/eluser] Ok - wait a sec. i was thinking of page caching (http://ellislab.com/codeigniter/user-guide/general/caching.html), not database cache (http://ellislab.com/codeigniter/user-guide/database/caching.html). Reading now - this looks like I totally need to give it a try. Thanks for the tip -- I'm on it. Page loads super duper slow [resolved] - El Forum - 09-26-2008 [eluser]tinawina[/eluser] Yep - that seems to be doing the trick. Thanks for this tip. CI and the CI community just keeps coming through when I need it most! THANKS! Page loads super duper slow [resolved] - El Forum - 10-30-2008 [eluser]tinawina[/eluser] Hello all - just in case this helps anyone thought I'd post the actual solution to my slow loading app problem. The answer ended up being MySQL database table (using phpMyAdmin's "optimize" option) and query optimization and, most importantly, correctly indexing my tables! That alone changed my query run-time from anywhere between 13 and 20 agonizing seconds to somewhere around .003 seconds. No joke. More good info on indexing is available in this article which really cleared up some stuff for me - hope it helps someone else: Database Journal Article. That's it! |