I'm using the CAS module which redirects to our centralized CAS login.

Because of this, when advagg scans the 'cas' path I get:

HTTP requests to advagg for css files are not getting through.
HTTP requests to advagg for js files are not getting through.

Is there a way to tell advagg to ignore this path so I don't have the errors show up?

Also, if I do have these errors, do they affect the functioning of advagg?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mikeytown2’s picture

Looks like there is a setting cas_exclude you can adjust to make the CAS module work with AdvAgg. If you go to admin/config/people/cas and under Redirection there should be a setting called "Excluded Pages". Add the following to the list

.*/advagg_css/*
.*/advagg_js/*
httprl_async_function_callback
ghosts’s picture

Thanks for the fast reply. I tried your suggestion and then cleared the AdvAgg cache (and then when that didn't work all caches). The error isn't CAS not working with AdvAgg rather, AdvAgg not playing nice with CAS.

Here is the error from the status report (I have a similar one for css files):

Adv CSS/JS Agg - HTTP Request HTTP requests to advagg for js files are not getting through.

AdvAgg will issue a request for a file that does not exist inside of the AdvAgg directory. If AdvAgg sends a 404, everything is ok; if something else sends a 404 then that means that AdvAgg will not be able to generate an aggregate if it is missing as something else is handling the 404 before AdvAgg has a chance to do it. If you are reading this, it means that something else is handling the 404 before AdvAgg can.

It seems the problem is that AdvAgg can't get a 404 because it hits a redirect.

Here is the raw output (edited for privacy):

stdClass Object
(
    [request] => GET /cas/login?service=http%3A%2F%2F*********%2Fdev%2Fsites%2Fdefault%2Ffiles%2Fadvagg_js%2Fjs__1388421866.js%3Fdestination%3Dsites%2Fdefault%2Ffiles%2Fadvagg_js%2Fjs__1388421866.js&gateway=true HTTP/1.0
User-Agent: Drupal (+http://drupal.org/)
Host: cas.*******.edu


    [data] => 
    [protocol] => HTTP/1.1
    [status_message] => Moved Temporarily
    [headers] => Array
        (
            [date] => Mon, 30 Dec 2013 16:44:26 GMT
            [server] => Apache-Coyote/1.1
            [pragma] => no-cache
            [expires] => Thu, 01 Jan 1970 00:00:00 GMT
            [cache-control] => no-store
            [location] => http://***********/dev/sites/default/files/advagg_js/js__1388421866.js?destination=sites/default/files/advagg_js/js__1388421866.js
            [content-length] => 0
            [connection] => close
            [content-type] => text/plain; charset=UTF-8
        )

    [code] => 302
    [redirect_url] => http://*********/dev/sites/default/files/advagg_js/js__1388421866.js?destination=sites/default/files/advagg_js/js__1388421866.js
    [redirect_code] => 302
)

If someone who knows this module better than me was to give me a hint of where to find in the code where AdvAgg look for files to aggregate I can look for a solution. The module is functioning well--I just would like to remove the status report errors which sometimes freak out my administrator users.

mikeytown2’s picture

AdvAgg has hidden settings. If you wish to disable the 404 check, add this to your settings.php file.

// Skip the 404 check on status page.
$conf['advagg_skip_404_check'] = TRUE;

My understanding from the initial support request was that the CAS module was creating the redirect. Do you know what is causing the 302 redirect?

ghosts’s picture

The CAS module creates the redirect. We are a university and require all users to authenticate through our central CAS server. A login maps to the path ./cas which is the source of the 302 to our centralized CAS server.

#3 removed the status report errors.

Thank-you.

mikeytown2’s picture

Category: Feature request » Support request
Status: Active » Fixed

Following the advice from #1, you could try this as the double wildcard match might not have worked.

sites/default/files/advagg_css/*
sites/default/files/advagg_js/*
httprl_async_function_callback

Going to mark this as fixed (as you seem happy) but allowing advagg to generate files on demand would be a good idea.

ghosts’s picture

I am quite impressed by your quick replies.

I undid #3 (disabling 404 checking in settings.php) and then followed your advice on #5 and no status report errors.

I am happy now. Thank-you!

mikeytown2’s picture

After looking at the CAS code you should add in services/* as this is excluded by default
http://drupalcode.org/project/cas.git/blob/d1d8bde786469c643ce2e94f36df8...

The following code has been committed.

Note that the patch is missing services/* but the actual commit has it in
http://drupalcode.org/project/advagg.git/commitdiff/c4677990400421ce05f7...

Status: Fixed » Closed (fixed)

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