I'm trying to deploy boost module on a high available environment.

Here is some back ground on our environment. We are on Solaris, two web servers on apache2 with NFS share and two multimaster replicated mysql databases. Also we are load balancing the two web servers via F5.

Here is the problem I'm able to install and run boost module without any problem on a single machine installation. But when i install the boost module on the multiple web server setup. Boost module will not create any pages.

I see the norm,perm and www.domain.com directories getting created under cache but no cache files are getting created. I tired different options like shutting down one machine working with one web server. None of the trick worked. Did any of you run into any such problem with the boost module. What could be the usual suspect if the cache files are not created under cache dir.

Also www.domain.com is a load balanced host name for our drupal deployment. When we disable the static page cache under boost setting we are able to access our site home page through our load balanced hostname(www.domain.com). If we enable the static page cache then try access the www.domain.com it looks like the site is getting loaded for a second then it gives the connections reset error message.

Any advise will be much appreciated. Thanks

Here the .htaccess file,

### BOOST START ###
AddDefaultCharset utf-8

Header set Expires "Sun, 19 Nov 1978 05:00:00 GMT"
Header set Cache-Control "no-store, no-cache, must-revalidate, post-check=0, pre-check=0"

AddCharset utf-8 .html
AddCharset utf-8 .css
AddCharset utf-8 .js

ForceType text/html

ForceType text/javascript

ForceType text/css

# NORMAL - Cached css & js files
RewriteCond /shared/drupal/cache/perm/www.domain.com%{REQUEST_URI}_\.css -s
RewriteRule .* cache/perm/www.domain.com%{REQUEST_URI}_\.css [L,QSA,T=text/css]
RewriteCond /shared/drupal/cache/perm/www.domain.com%{REQUEST_URI}_\.js -s
RewriteRule .* cache/perm/www.domain.com%{REQUEST_URI}_\.js [L,QSA,T=text/javascript]

# Caching for anonymous users
# Skip boost IF not get request OR uri has wrong dir OR cookie is set OR request came from this server OR https request
RewriteCond %{REQUEST_METHOD} !^GET$ [OR]
RewriteCond %{REQUEST_URI} (^(admin|cache|misc|modules|sites|system|openid|themes|node/add))|(/(comment/reply|edit|user|user/(login|password|register))$) [OR]
RewriteCond %{HTTP_COOKIE} DRUPAL_UID [OR]
RewriteCond %{HTTPS} on
RewriteRule .* - [S=1]

# NORMAL
RewriteCond /shared/drupal/cache/normal/www.domain.com%{REQUEST_URI}_%{QUERY_STRING}\.html -s
RewriteRule .* cache/normal/www.domain.com%{REQUEST_URI}_%{QUERY_STRING}\.html [L,T=text/html]

### BOOST END ###

CommentFileSizeAuthor
#13 Boost.png37.68 KBwafer
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mikeytown2’s picture

no files are being created, correct? On the boost settings page set the verbose level to 9; it should tell you in the watchdog why it can't cache the page.

AlexisWilke’s picture

Version: 7.x-1.0-beta2 » 6.x-1.17

I ran in that problem for a little while (actually NONE of my pages would be saved in a sub-folder, only those in the top folder.) With the "latest" 1.x-dev it now works (i.e. Oct 18, 2010 version.)

One of the errors I can see is an implode():

Type php
Date Wednesday, October 20, 2010 - 18:45
User Anonymous
Location http://snapwebsites.info/journal
Referrer
Message implode() [function.implode]: Invalid arguments passed in /usr/clients/www_html/new.m2osw.com/public_html/sites/all/modules/boost/boost.module on line 2140.
Severity error
Hostname 123.123.123.123
Operations

The code I had on line 2140 did not correspond to an implode()... so I'm not too sure what the errors was about.

Thank you.
Alexis

vangorra’s picture

Version: 6.x-1.17 » 7.x-1.0-beta2

Still happening for me. Any ideas?

h3rj4n’s picture

Would be nice if the boost module checks if the dir exists and if it can be writen by the module / drupal.

Anonymous’s picture

Version: 6.x-1.17 » 7.x-1.0-beta2
Status: Active » Closed (works as designed)

erm, on 7.x-1 it already does, in status report you get this message if the directory is not writeable

Boost Can not write to file-system
Directory /var/www/html/drupal/cache/normal credentials - Permissions: 0555. Owner 48. Group 48.
Your credentials - Group ID: 48. User ID: 48. Current script owner: apache.

(except it's in red).

abhitesh.das’s picture

Status: Closed (works as designed) » Active

I ran into the same issue.
Boost doesn't creates the cache files, the only file I could find in the cache/normal/example.com is .htaccess

Things we tried to resolve this:

  1. Change the access permission to 777 for the folders
  2. Disabling the error reporting for the website.

But, unfortunately, none of the above worked.

However, when I installed it on the other server a few weeks ago, it worked perfectly fine. This time its not creating cache files. We have ensured the process followed for both the installation is same.

Any help/guidance is highly appreciated.

Anonymous’s picture

the only file I could find in the cache/normal/example.com is .htaccess

So you did not create this file or folder structure ? which would suggest that boost can write to the file system.

With non-creation of files normally it's because a module (other than boost) is setting DRUPAL_UID which you can check for in developer tools in chrome or firebug in firefox.

abhitesh.das’s picture

@Philip :

Thanks for your response.. :)
You are right, I can see the DRUPAL_UID is set to '-1' even for the anonymous user.
I have checked the complete code base and couldn't find DRUPAL_UID being used in any module except Boost.

However, I am facing a strange issue. When I visit the home page, it creates the cache file, but for rest it doesnt creates the cache file.
Though I am not sure if this has got something to do with .htaccess, below is the htaccess code generated by Boost module.

  ### BOOST START ###

  # Allow for alt paths to be set via htaccess rules; allows for cached variants (future mobile support)
  RewriteRule .* - [E=boostpath:normal]

  # Caching for anonymous users
  # Skip boost IF not get request OR uri has wrong dir OR cookie is set OR request came from this server OR https request
  RewriteCond %{REQUEST_METHOD} !^(GET|HEAD)$ [OR]
  RewriteCond %{REQUEST_URI} (^/(admin|cache|misc|modules|sites|system|openid|themes|node/add|comment/reply))|(/(edit|user|user/(login|password|register))$) [OR]
  RewriteCond %{HTTPS} on [OR]
  RewriteCond %{HTTP_COOKIE} DRUPAL_UID [OR]
  RewriteCond %{ENV:REDIRECT_STATUS} 200
  RewriteRule .* - [S=3]

  # GZIP
  RewriteCond %{HTTP:Accept-encoding} !gzip
  RewriteRule .* - [S=1]
  RewriteCond %{DOCUMENT_ROOT}/cache/%{ENV:boostpath}/%{HTTP_HOST}%{REQUEST_URI}=%{QUERY_STRING}\.html -s
  RewriteRule .* cache/%{ENV:boostpath}/%{HTTP_HOST}%{REQUEST_URI}=%{QUERY_STRING}\.html [L,T=text/html,E=no-gzip:1]

  # NORMAL
  RewriteCond %{DOCUMENT_ROOT}/cache/%{ENV:boostpath}/%{HTTP_HOST}%{REQUEST_URI}=%{QUERY_STRING}\.html -s
  RewriteRule .* cache/%{ENV:boostpath}/%{HTTP_HOST}%{REQUEST_URI}=%{QUERY_STRING}\.html [L,T=text/html]

  ### BOOST END ###

Anonymous’s picture

Ok, DRUPAL_UID is a flag cookie set that states "this user is not anonymous" so what you need to do is find out which module is create a drupal session (which may be faked)so you need to find out what is setting a cookie like

SESS01653194f68663b9145245dbd3a618ec=mwlDhNm12kBwfDowiRtzArB9_6XqjdtrwiFgTmyNrRg; expires=Wed, 10 Jul 2013 19:50:22 GMT; path=/; domain=.howtogetdivorced.com; HttpOnly

It may be your theme if it is responsive, or it may be some module that is moving towards drupal "contextual" features which are supposed to deliver stylesheets based on device and screen size.

In "standard" drupal then the session is only established once the user is logged in and then the boost flag cookie is set, but some modules do not obey this and instead of using their own cookie system (which would be module best practice) they use a drupal session. I'd search for

setCookie

or more likely

session_start

in your modules folder using a text editor with a global search function.

Hope this helps.

berliner’s picture

Also drupal_session_initialize() in includes/session.inc will prevent caching when $_SESSION is not empty:

  // We use !empty() in the following check to ensure that blank session IDs
  // are not valid.
  if (!empty($_COOKIE[session_name()]) || ($is_https && variable_get('https', FALSE) && !empty($_COOKIE[substr(session_name(), 1)]))) {
    // If a session cookie exists, initialize the session. Otherwise the
    // session is only started on demand in drupal_session_commit(), making
    // anonymous users not use a session cookie unless something is stored in
    // $_SESSION. This allows HTTP proxies to cache anonymous pageviews.
    drupal_session_start();
    if (!empty($user->uid) || !empty($_SESSION)) {
      drupal_page_is_cacheable(FALSE);
    }
  }
Makdomen’s picture

I have just uninstall removes all data related to a module and that instal the module and works OK

ivanzhu’s picture

There is another reason could incur this error: No disk space any more on your server....

wafer’s picture

FileSize
37.68 KB

I am newbie as a Drupaler,I have recently installed boost for my project, surprisingly it won't generate cache files under my project directory which is under my [project-folder]/cache/normal/[project-name]/

The directory automatically creates while i have installed boost,but it doesn't save the purpose,how could i resolve the issue?I have also put the .htaccess data to my project's .htaccess file..

Thanks,Your solicit help appreciated.

Anonymous’s picture

There are a number of possible answers.

  1. a permissions problem where suPHP can only write to a directory with certain permissions (in which case check web server logs) or create a PHP program and use touch() to test what permissions are created and then try and place a file using this program in the cache directory
  2. you have a module installed that disables boost (anything with a valid drupal session cookie would do this), try surfing the site with a different browser as an anonymous user
  3. you are using a https website which will not work with boost.
wafer’s picture

Actually permission was not the rival, i have already added in group(chgrp),the problem that i was facing is persisted when i have set logging and errors notification setting in config to none. Could you tell me why it was happening while it's not documented anywhere for fixing this issue.

Actually i was just finding around,luckily found myself,but it should have some reason..

If you found please share it.

Anonymous’s picture

I do not quite understand your english (sorry).

Are you saying that on your boost installation when you turn on logging that no cache file are created ?

wafer’s picture

On the admin page admin/config/development/logging, under the section "Error messages to display", when "All messages" is set, boost doesn't work i.e. the cache files are not generated at all. However if the setting is changed to "None", the cache files starts getting generated.

Please advise if this is the expected behaviour.

smitty’s picture

Unbelievable but true: I also have got two test installations where - out of a sudden - the creation of cache-files stopped. As soon as I changed on admin/config/development/logging "Error messages to display" to another value than "All messages" the cade-files are generated again.

That's strange, isn't it?

Makdomen’s picture

Hi,
When you clear the cache or install the boost module, clear the browser's history.
The browser's do not allow to create a new cache in the database, because they already have create cache files in the history.