Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Function: tagCloud
#9
internet54 Wrote:My concern is that your opening every file on every load.
There is a large overheat, yes. This due to the multiple uses of menu_data(). The best way would be to cache the contents of that function somewhere. If you were to use this function here you are calling menu_data() for your menu (where it will walk through every single XML file) and afterwards you call it again just to generate this tag cloud (where it will, again, walk through all files).

Other than that GetSimple has minimal overheat. It takes the overall configurations file to get stuff like the site name, it gets the XML file for the current page and when requested by the theme it will read the components file. The amount of files read for this could only be made less by porting the site name and overall settings like that to every single page file. This will raise the amount of space taken on the server though.

So maybe a file containing the XML often given by menu_data() will save us most of the overheat, and with that most of the requests. This should not be limited to just tags.

If you care to fix it for your website already you could write your own menu function, or use mine, to call menu_data() to some variable. Then this same variable can be used by your menu and by this tag cloud function. That way you will only be reading through those files once instead of multiple times.

Might be interesting to hear what Chris thinks about this? As he often said menu_data() was imperfect.

internet54 Wrote:when you open the file isn't it cached to the browser for quick access?
What file? The XML files? No. The browser never actually sees those, everything gets sorted by PHP and I don’t think the server caches the XML files that are already stored by it. That would be redundant.
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply


Messages In This Thread
Function: tagCloud - by n00dles101 - 2009-11-20, 21:04:58
Function: tagCloud - by Zegnåt - 2009-11-20, 22:03:01
Function: tagCloud - by n00dles101 - 2009-11-20, 23:45:04
Function: tagCloud - by ccagle8 - 2009-12-09, 08:13:02
Function: tagCloud - by Jamz - 2009-12-15, 08:52:39
Function: tagCloud - by n00dles101 - 2009-12-15, 19:50:43
Function: tagCloud - by Zegnåt - 2009-12-15, 19:56:06
Function: tagCloud - by internet54 - 2009-12-16, 02:53:14
Function: tagCloud - by Zegnåt - 2009-12-16, 03:53:18
Function: tagCloud - by n00dles101 - 2009-12-16, 05:04:44
Function: tagCloud - by homershines - 2010-04-21, 14:04:28
Function: tagCloud - by Zegnåt - 2010-04-23, 00:57:21
Function: tagCloud - by homershines - 2010-04-23, 02:55:17
Function: tagCloud - by Zegnåt - 2010-04-23, 07:07:39
Function: tagCloud - by kirillaristov - 2010-04-24, 01:11:12
Function: tagCloud - by homershines - 2010-04-24, 04:53:54
Function: tagCloud - by n00dles101 - 2010-04-24, 05:58:51
Function: tagCloud - by homershines - 2010-04-24, 22:31:46
Function: tagCloud - by banter - 2010-04-27, 18:30:05
Function: tagCloud - by n00dles101 - 2010-04-27, 18:59:05
Function: tagCloud - by homershines - 2010-04-29, 00:25:26



Users browsing this thread: 1 Guest(s)