articles
articles (10)
What You Are
Oct
28
- written by: Nick @ 2:10 pm on Oct 28, 2004
- categories: Quicklinks
- viewed: 1785 times
- comments: 6 Comments
28
derek comes out
Oct
25
- written by: Nick @ 3:21 pm on Oct 25, 2004
- categories: Quicklinks
- viewed: 1576 times
- comments: 5 Comments
25
PHP Lesson on the ‘include’ statement
Oct
25
I got a nice little lesson in PHP this morning…I’d been noticing that since last night, my front page had been loading really slowly, maybe 15-20 seconds to load just the main page…I figured it had something to do with some RSS feeds that I was parsing and displaying on my front page, maybe MagpieRSS wasn’t caching the feeds right, or I hadn’t set permissions on the cache directory correctly…I added some logging to my page, and started pouring over the results…I basically pinpointed it down to one line, which was this include statement:
//If you don't know, get_settings('siteurl') is a WordPress function to get the URL of your site…
include(get_settings('siteurl').'/includes/magpieRSS/rss_fetch.inc');
apparently, this call was taking 20 seconds to resolve…so I simply removed the get_settings call from the include and just made it:
include('includes/magpieRSS/rss_fetch.inc');
and magically, my page was back to functioning normally…evidently, by forcing the include to try and use the full URL path to the file, instead of a more direct relative path, I was killing the performance of my page…so yeah, I guess the point was, learn from my mistakes and don’t do that in your include statements…
- written by: Nick @ 2:36 pm on Oct 25, 2004
- categories: PHP, Wordpress
- viewed: 2133 times
- comments: 6 Comments
25
I got a nice little lesson in PHP this morning…I’d been noticing that since last night, my front page had been loading really slowly, maybe 15-20 seconds to load just the main page…I figured it had something to do with some RSS feeds that I was parsing and displaying on my front page, maybe MagpieRSS wasn’t caching the feeds right, or I hadn’t set permissions on the cache directory correctly…I added some logging to my page, and started pouring over the results…I basically pinpointed it down to one line, which was this include statement:
//If you don't know, get_settings('siteurl') is a WordPress function to get the URL of your site…include(get_settings('siteurl').'/includes/magpieRSS/rss_fetch.inc');
apparently, this call was taking 20 seconds to resolve…so I simply removed the get_settings call from the include and just made it:
include('includes/magpieRSS/rss_fetch.inc');
and magically, my page was back to functioning normally…evidently, by forcing the include to try and use the full URL path to the file, instead of a more direct relative path, I was killing the performance of my page…so yeah, I guess the point was, learn from my mistakes and don’t do that in your include statements…
Scrotal Safety Commission
Oct
22
this is good advice…i think my new “safe-word” will be “porky pine”…
- written by: Nick @ 3:16 pm on Oct 22, 2004
- categories: Quicklinks
- viewed: 1710 times
- comments: 2 Comments
22
this is good advice…i think my new “safe-word” will be “porky pine”…