Hi, I have a drupal installation with three domains, e.g. domain1.com, domain2.com and domain3.com. On the performance config page, I have to enter a cache file path. THis is automatically shown as cache/www.domain1.com. So I click save and try out the boost module. I start browsing on domain2.com.

Problem? Cache files for domain2.com are saved in cache/www.domain1.com ... I tried to use i18n_variables to make that input field multilingual, (to enter different values per domain/language) but that does not work.

Apparently this logic does not work. Of course the cache file path should NOT automatically include a www.domain1.com, it should only have "cache" and dynamically decide which domain to add after the slash.

What to do to make it multi site?

CommentFileSizeAuthor
#17 boost-478644.patch967 bytesmikeytown2
#6 boost-478644.patch2.27 KBmikeytown2
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Anonymous’s picture

So my point is, I have a single database for three domains. I need to split the "cache file path" value across three domains, within one database. I understand it would have worked, If I had used three separate databases.

Anonymous’s picture

Status: Active » Closed (fixed)

I solved my problem by changing:

define('BOOST_FILE_PATH',            variable_get('boost_file_path', boost_cache_directory(NULL, FALSE)));

hardcoded into

define('BOOST_FILE_PATH',            variable_get('cache/'.$_SERVER['HTTP_HOST'], boost_cache_directory(NULL, FALSE)));

There should be an option to do this. Or at least a token [http_host] to work with in cache path. I dont know how else to make boost 'really' multisite, if you cant work from 1 database.

Anonymous’s picture

Status: Closed (fixed) » Needs review

By the way, I want to express my utmost gratitude for this module! I got it working multisite, and JEZUS CHRIST its 100x faster! I have fast traffic hosting, but Drupal demands way too much PHP processing. Those days are over! Thanks!

mikeytown2’s picture

Status: Needs review » Needs work

Thanks for the report; I haven't encountered people doing a multisite off of one database. I'll work on an option in administration that will allow for this.

mikeytown2’s picture

Title: Multisite cache file path seems to be illogical » Multisite cache file path & one database

you should probably run your code like this since there isn't a variable in the database called 'cache/'.$_SERVER['HTTP_HOST']

define('BOOST_FILE_PATH',            boost_cache_directory(NULL, FALSE));
mikeytown2’s picture

Status: Needs work » Needs review
FileSize
2.27 KB

here's a patch that adds a setting under admin/settings/performance => Static page cache => Advanced settings => Do not store the cache file path in the database. Enable it and let me know if it works for you.

mikeytown2’s picture

Status: Needs review » Fixed

committed

Anonymous’s picture

Wow, thanks for following up!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

dankohn’s picture

Title: Multisite cache file path & one database » Cache file path shouldn't require hardcoded site name
Version: 6.x-1.0-alpha4 » 6.x-1.14
Status: Closed (fixed) » Active

Hi, I'm not seeing this option "admin/settings/performance => Static page cache => Advanced settings => Do not store the cache file path in the database". It's an issue because I move the same database between a staging and a production server. I don't want this path to be hardcoded in, nor should it need to be, since boost knows the name of the server. When I manually changed it to "cache/thissite" I got this error on my status page:

Cache file path: is not set to the default(cache/dev.healingthresholds.net).

The simplest solution may be to just allow the "Cache file path:" to be empty, and say that if it is, it will default to "cache/dev.healingthresholds.net". That way, only people who manually want to set it need to.

mikeytown2’s picture

It's moved to "Boost directories and file extensions"
http://drupal.org/node/545908#direct

Close this issue if that solves your problem.

dankohn’s picture

Sorry, I don't think I understand. I'd like to change "Cache file path:" to something that doesn't rely on a domain name. Your documentation says that the"default setting is to store the files in a directory named cache/normal/". But the comment under the "Cache file path:" setting says "The default setting is to store the files in a directory named cache/dev.healingthresholds.net under the Drupal installation directory". When I change that to "cache/normal/", I get this yellow warning message on the status page:

Boost Cache path
Cache file path: is not set to the default(cache/dev.healingthresholds.net).

What I'm requesting is:
1) if using "cache/normal/" works, don't create a warning message, and make it the default.
2) Either way, interpret a null "Cache file path:" as "use the default".

mikeytown2’s picture

What happens when you check the "Do not store the cache file path in the database" check box? The Cache file path text box should go away

dalin’s picture

would it make more sense if the default was to not store the value in the database, but give the admin the ability to override it? Makes sense to me since a good percentage of sites that use Boost will be using it in a multi-stage development environment (i.e. dev.site.com, staging.site.com, www.site.com). Which is effectively a multi-site installation. In scenarios like this you often need to copy a database from one site to another and then I'm always Whiskey Tango Foxtrot why isn't Boost working? Oh yeah I need to change things on the Boost settings page.

I'm guessing that on the flip side there aren't too many use cases for needing a custom directory within the cache folder.

dankohn’s picture

Component: Documentation » Code
Category: support » feature

Yes, changing the default would make a lot of sense. If it auto-creates in the right directory, I think few people will ever bother changing it.

But I would like to confirm that the settings suggested to me did just what I need, and so I'm all set. I'm changing to a feature request, but please feel free to close out.

mikeytown2’s picture

Title: Cache file path shouldn't require hardcoded site name » Cache file path shouldn't be stored in the DB by default

Good point; I'll change the default.

mikeytown2’s picture

Status: Active » Needs review
FileSize
967 bytes
mikeytown2’s picture

Status: Needs review » Fixed

committed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.