This is what I'm thinking...

%{DOCUMENT_ROOT}/cache/%{ENV:rand}/%{HTTP_HOST}/%{HTTPS}/%{ENV:theme}/%{ENV:role}/%{ENV:i18n_geo}/%{REQUEST_URI}_%{QUERY_STRING}\.html -s
# Set Defaults
[E=rand:boost] #random 32 ascii char's to prevent directory guessing - Default is boost for easy setup.
[E=theme:all] #mobile would go in here
[E=role:anonymous] #or authenticated
[E=i18n_geo:none_none] #site's default language code and geo location

I would like to use %{REQUEST_SCHEME} instead of %{HTTPS} but that is only available in Apache 2.3+.

Quick issues:
- rand needs to be shared across all multisite installs. A file that is not servable from Apache is the answer. Thinking a hidden dot file in the cache dir; or by checking the dir structure.
- %{HTTPS} will need to be transformed to 'http' or 'https' in order to match cores $http_protocol = $is_https ? 'https' : 'http'; in drupal_settings_initialize.

Example url:
http://example.com/about-us
Filename:
cache/boost/example.com/http/bartik/anonymous_user/none_none/about-us_.html



These 3 settings (theme, role, i18n_geo) can then be set via htaccess rules (browser/cookie detection; etc). Role will be handled by boost; each role will get a cookie which is md5(role name + salt). Anonymous assumes no role cookie. Need to handle multiple roles. Need to handle multisites. in order to use role one must set rand. Will need to come up with a method for changing the salt every X days to keep the cookie for that role a secret. Also need some JS to remove the boost role cookie if the session cookie is gone. Role is a big issue. Or authcache integration...

i18n can be handled by simple rules like this
geo can be handled by an addon like MaxMind's.

theme would be for mobile browsers; to switch the theme to a mobile version.
http://sourceforge.net/projects/mobilefilter/
http://stackoverflow.com/questions/1005153/auto-detect-mobile-browser-vi...
Another use is if user has a theme cookie.



Why?
This will allow for many different variants of the same URL. GeoIP and Mobile are the 2 biggest reasons for this IMHO.

Comments

geerlingguy’s picture

I think that will be a pretty robust naming structure. I can't think of anything you're missing...

mikeytown2’s picture

Thought about this more and some sites will have different sections use different themes. In short the theme modifier needs to be smart. I was hoping I could make a dumb version but that won't work across the board.

mrfelton’s picture

I wonder if having separate cache for http and https would allow securepages to function correctly? Right now, it doesn;t seem to be compatible with Boost at all, because as soon as the page is cached, it is then served from the cache from then on, and so securepages never comes into play and isn't able to redirect between http and https like its supposed to.

ralf.strobel’s picture

This should be exposed as a setting for the site admin. I would actually prefer a lightweight path structure in many setups, such as just "%{DOCUMENT_ROOT}/cache/%{REQUEST_URI}".

But of course there has to be a reasonable default that should cover more complex scenarios as well.

In any case, I would definitely like to get rid of the hardcoded "normal" path segment, which has no real purpose for me. A flexible, configurable folder structure is very desirable.