Forum OpenACS Q&A: Re: Re: understanding paths and structure

Collapse
Posted by Iuri Sampaio on
I barely understood what you meant. I'm sure it's because i'm not that furhter on oacs yet. I just need more time.
What about the requests those don't use the database, even permissons, like the second one that is only on the adp file. and it seems to be inverted

**********************
on the file: "dotlrn-master-kelp.adp" located in "/home/yabtdev/yabtdev/packages/dotlrn/www/"

I have the tag
link rel="stylesheet" type="text/css" href="/resources/dotlrn/dotlrn-master-kelp.css" media="all"

and the file "dotlrn-master-kelp.css" is located on
/home/yabtdev/yabtdev/packages/dotlrn/www/resources/dotlrn-master-kelp.css

but the folder /dotlrn/ bellow /resources/ doesn't even exist.
In my view the right path should be
link rel="stylesheet" type="text/css" href="/packages/dotlrn/www/resources/dotlrn-master-kelp.css" media="all"
************************************

Collapse
Posted by Don Baccus on
It is inverted (/resources/package-key rather than /package-key/www/resources) to simplify the recognition of the URL pattern for resources.

This is done for performance reasons. Dynamic pages are served by the request processor (see the Tcl proc "rp_filter" in packages/acs-tcl/tcl/request-processor-procs.tcl). Before being served, the request processor checks to see that the user has READ permission for the requested page, and sets up many the ad_conn structure with information that's useful for dynamic pages (the user_id associated with the request, the package_id of the package owning the page, etc etc).

The permissions checking and the setting up of the ad_conn structure takes a few milliseconds on typical x86 hardware running Postgres, AOLserver and Linux.

Static files like images, CSS files etc do not need the information set up in the ad_conn structure. It is typically OK to allow those used internally in .adp files to be read by any visitor. Therefore the permission checking and ad_conn set-up is skipped for files whose URL starts with /resources. We save a few milliseconds per resource request, and for sites that are decorated with many GIFs or heavily use CSS files the savings per page view can be significant.

Hope this helps ...

Collapse
Posted by Iuri Sampaio on
I've read the page "packages/acs-tcl/tcl/request-processor-procs.tcl". I could understand some points but It's still sort of chinese to me. =)

ad_proc -private rp_resources_filter { why } {

This filter runs on all URLs of the form /resources/*. The acs-resources package
mounts itself at /resources but we short circuit references here in order to
maximize throughput for resource files. We just ns_returnfile the file, no
permissions are checked, the ad_conn structure is not initialized, etc.

There are two mapping possibilities:

/resources/package-key/* maps to root/packages/package-key/www/resources/*

*******************8
" Keep in mind that if you do an internal redirect to something other than
the current directory, relative links returned to the clients
browser may be broken (since the client will have the original URL).""

I understood "internal redirect" as if i try to include pages those are "i don't knnow" or if the pages needs permission. Is that correct?

Another thing is...
I couldn't match this with the header metatags. I mean, how do they go to the final page, on the client side(i.e. on the user's browse). Can you tell how they go to the page? Where are the metatags actually located?

I want to track and debug the whole process that it takes since the begining(i.e. the first step) to the end(i.e. user's browser).