I use multilingual and boost module in drupal system,
but i didn't use prefix for my language, use new domain for different language such as below:

www.test.com (main domain)
nl.test.com (if use prefix for language it sill like this, www.test.com/nl/, this can works for boost)

how it let language domain works with boost module, i use 6.x-1.18 version for boost module.
i check the cache, normal folder, all static file for different domain language will get same HTML files. can't have any nl.test.com or no.test.com folder be created.

#8 Selection_001.jpeg175.56 KBnathan.zhu
#8 Selection_002.jpeg321.63 KBnathan.zhu
Members fund testing for the Drupal project. Drupal Association Learn more


mikeytown2’s picture

Title: multilingual domain doesn't works with boost » multilingual subdomain doesn't work with boost

www.example.com <- Works
en.example.com <- Broken
fr.example.com <- Broken
nl.example.com <- Broken
www.example.com/en <- Works
www.example.com/fr <- Works
www.example.com/nl <- Works

What module are you using?

nathan.zhu’s picture

i just use core locale language module, and use new domain
such as nl.test.com or no.test.com
for different language in language settings page

so, how to let boost module can create language domain for multilingual. please help it, thanks.

mikeytown2’s picture

Core's Locale module.
Is there a guide I can follow so I can replicate your setup; using sub domains instead of subdirectories?

nathan.zhu’s picture

The problem you already reappeared on you local.
sorry, what's you mean (instead of subdirectories), i can't understood, can you explain some detail?

ho, yeah, i got it, that's what i want to get. use language domain to instead of subdirectories. great.

thanks, again.

mikeytown2’s picture

Did you follow a guide like this for your current drupal setup?
http://drupal.org/node/339381 - Do you have different settings.php files, one for each domain?

nathan.zhu’s picture

no, there don't have special setting for language domain in settings.php file, i only configure them at language setting page, add new language then go to this page add new domain (admin/settings/language/edit/nl)

rsvelko’s picture

Status: Active » Postponed (maintainer needs more info)

please nathan - give us a list of the exact names of all modules Enabled on your site + if you would - the url. A screenshot, text paste , anything.

I did not know that subdomain i18n sites (de.example.com, en.example.com ) can be done without the i18n module - but it is indeed so:

all you need is Locale + Content Translation (both core optional).

The DNS should be setup too...

More info and bug reports needed.

nathan.zhu’s picture

321.63 KB
175.56 KB

Hi, rsvelko

Sorry, respond too late. You are right, I should give more info about it.

Here is my enabled modules list:

I add new domain like screenshot and still add it on hosts file

but can't create subdomain in cache folder.

Please help on it, thanks.

nathan.zhu’s picture

Hi, anybody can help on this? thanks

Jolidog’s picture

Status: Postponed (maintainer needs more info) » Active

let's mark it as active, so the maintainers know they have more information.

nathan.zhu’s picture

i found some problem, it's not some module's problem, it's base_url setting problem, The boost module will not works when set base_url variable in setting.php files. such as $base_url = "http://www.drupal.local"

so if I have to use this parameter in setting files how to let boost works with it, Please help on it. thanks

nathan.zhu’s picture

Hi, guys, keep update

these days i focus on this issue, hope let it boost works with multilingual subdomain, follow the found problem about $base_url parameter.

make some test on local, fortunately i make a change for boost module (version is 6.x-1.x-dev) on line 3560


$temp_base_url = $base_url;

change to

$temp_base_url = 'http://'. $_SERVER['HTTP_HOST'];

Notes: there have another part need be setting for i18n module in boost admin interface, admin->settings->performance->boost

For the (i18n) and the (Domain) modules:
[x] Do not store the cache file path in the database
[x] Flush all sites caches in this database (singe db, multi-site)
[ ] Only allow ASCII characters in path

Enable XML & AJAX/JSON caches
[x] Cache .xml & /feed
[x] Cache ajax/json

To Use the Cron Crawler
[x] Overwrite the cached file if it already exits
[x] Expire content in DB, do not flush file.
[x] Enable the cron crawler

it will support to create static files for different language.
Test is works for me.

heydemo’s picture

My patch here:
Allows Boost to cache subdomains correctly when $base_url is set - however, we still need a method for clearing cached subdomains when $base_url is set

heydemo’s picture

Just read on the settings page that multisites are supposed to set up cron runs for each site...this seems less than ideal, not sure the best place to specify to Boost to expire all sites content. Would you be willing to incorporate this type of functionality into Boost if I coded it?

mpoulsen’s picture

I have the same problem in Drupal 7. Got multiple domains for different languages.

Boost creates the cached files in:


But the cron job only clears the content of:


But why not just do let the _boost_rmdir() function go through the whole cache folder?

Until this bug is fixed, if any other has this problem, you can just implement your own cronjob:

if (function_exists('_boost_rmdir') && function_exists('boost_get_normal_cache_dir')) {
  function your_module_cron() {
    _boost_rmdir(boost_get_normal_cache_dir(), false);

The second parameter in the _boost_rmdir function indicate only to remove expired pages. So it should be safe to run as often as your would like (?).

tangent’s picture

Do we need to distinguish between domain and subdomain for the purposes of this issue?

Like mpoulsen my site uses separate domains (not subdomains) for each language.

It sounds like the solution for "language selection = domain" would involve discovering every domain associated with the site and expiring all of the associated cache directories.

bgm’s picture

@mpoulsen: Clearing the cache for all domains at once would cause issues for multi-sites managed by different people. Cron would run on each of those sites, and it would run through the cache directory of each site too often (imagine a small multi-site farm with 50 sites).

@heydemo: Can you provide a link to the documentation that recommends running cron on each domain? (is this a requirement from Boost or another module?).

mehlbye’s picture

Issue summary: View changes

I figure that the problem is that the Boost module only clears files on the domain that cron runs from.

example.com <-- works out of the box. Boost HTML files gets flushed when they expire.
en.example.com <-- didn't work.

Got this working by manually running cron from the subdomain that didn't work.

Inserted this to servers cron job

15 * * * * /usr/bin/curl http://en.example.com/cron.php?cron_key=[key-from-your-site] 2>&1 >> /tmp/cron.errors >/dev/null 2>&1

(runs every hour at quarter past)