Forum OpenACS Development: Re: stable urls for all objects

Collapse
Posted by Dirk Gomez on

Tom, the /o/$object_id is merely a replacement for the site_node.get_url function if you want to create lists of links. It defers the expensive process of calculating the URL. The assumption here is that there fairly many pages in a web system that show fairly many links. Take portal: a regular portal page may show 5 portlets with 10 links each. Your site calculates 50 URLs although the user can click at most only one at a time.

On an Oracle-backed OpenACS system with 329 site nodes this is the price:


SQL> -- gee, no bind vars
select site_node.url(node_id)
          from site_nodes where object_id= 93013;

Statistics
----------------------------------------------------------
          5  recursive calls
          0  db block gets
         12  consistent gets


site_node.url is a recursive function that gets more expensive the more nodes you add.

In short /o (or LC_$ISOCODE/o) would supersede most calls of site_node.url thus saving overall load on the system and will not compromise security.