Sadly I am not happy with the solution as it requires a trip to the database. Why ?
The method I use is to go from the root node and for each subsequent node in the URL I will load the subpart into the database if it is not already there. I stop the moment I am not finding the next part in the database and return with the previous node. As you can see this results in any case in a trip to the database, unless we are querying the root of a package. Why is that? The site node cache is only for packages and folders, it does not take into account the file names. So if you have /file-storage/folder-view, /file-storage would be in the site_nodes table, folder-view would not. But there is no way for me to predetermine if it is or not unless I hit the database.
The next thought I have now is to add a "no_children_p" entry to the site_nodes NSV. This will tell me that there are no more children for the particular site_node I am looking at so I do not have to do the last look at the database. As the site node is flushed whenever I add a child, I should be save from making a lot of code changes just to keep track of the variable.
Does this approach make sense to you? Did I miss something? And does this affect the XoTCL request processor, do I need to make changes to xotcl-core as well, as I am changing site_node::get_from_url as the only place to query the site_nodes NSV at the moment.
Request notifications