How does this deal with existing Caching, CSS Aggregation, and the JS Aggregator?
aerodog - July 21, 2008 - 17:17
| Project: | SmartCache |
| Version: | 5.x-1.x-dev |
| Component: | Miscellaneous |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
Hello!
I also wanted to use Drupal's built-in Performance options to enable caching and css aggregation. I also wanted to use the Javascript Aggregator. Does this conflict with those guys? If so, what should I opt for? Thanks,
Aerodog

#1
Hi,
SmartCache is transparent to every other module.
So, CSS aggregation and JS aggregation are intended to create JS and CSS files.
SmartCache intercepts CSS and JS requests and sends a gzipped version of your existing CSS and JS files.
In short, no, there are no conflicts.
#2
Automatically closed -- issue fixed for two weeks with no activity.
#3
I'm using the javascript aggreagator module and smartcache is not gzipping the js file produced by the js aggregator module. If I disable the js aggreagor it compresses all the unbundled js files just ok. I'm using drupal 5.10.
#4
This should work given that the output of js aggregator is a js file. SmartCache will serve .js and .css files only.
Is redirect working?
#5
Smartcache is working ok if I disable the javascript aggregator. When js aggregator is enabled the only file that isn't gzipped is the js file produced by js aggregator.
#6
I see...
Where is js aggregator putting the file in?
I mean: the redirect in your .htaccess file is in a directory parent of where is aggregator putting files?
I'm not sure if this is clear: if you put the redirect in, say, /root/drupal/.htaccess and aggregator is putting files in /root/files/... the redirect rule can't work.
If that is the case you have to put another .htaccess on the /root/files/ directory.
It seems to me it's probably a redirect issue instead that an issue with SmartCache or aggregator.
Hope it helps.
#7
The rewrite rule is in /drupal/.htaccess and the js files are in /drupal/files/js. So the rule is in the parent directory.
#8
I can't think of a single reason why it should not work...
So if you write the full link to an aggregated js file ("http://yoursite/files/js/afile.js") the system will give you a non-compressed version of it?
You checked there are no conflicting redirect rules?
#9
Yes, I will get an uncompressed version of the file. Could you test it yourself also. As I said, it's working if I disable the javascript aggreagor module. I can definately see the smartcache module working, cause yslow shows it cuts my page size in half.
#10
I really don't know what the problem could be...
Just a last check: if you browse the drupal/files and drupal/files/js directories, are there .htaccess files?
Those files could overwrite the one in drupal directory.
If there are no additional .htaccess files and the js files are correctly present in the drupal/files/js directory, if you manually write the address of one of them in your address bar, SmartCache should work. Definitely.
To check if the redirect rule is working: enable debug mode (set DEBUG = true in load.php) and insert a bad link in the address bar (e.g. drupal/files/js/nofile.js)
If you get a "404 not found" the rewrite rule is NOT working. The 404 is thrown by Apache.
If SmartCache gets your request when debug is enabled, it should give you a page with a popup saying "file not found".
In the first case it's a rewrite rule problem and you should double-check .htaccess rules, in the latter, everything should work as expected, and if it doesn't, I fear I can't be of much help.
Sorry for being late, I've been very busy.
#11
Yes, there is a .htaccess file in the files directory, but if I make any changes in there it breaks my site (no graphics, no css, no js). I also tried adding a .htaccess file to the /files/js folder, but that way I got a 404 error when trying to access the js file.
And the rewrite rule is working. I just double-checked it. I got the popups from smartcache. My only conclusion is that it somehow conflicts with the js aggregator module, cause it gzips the seperate js files if they are not aggregated. I'm relying on yslow output on those statements.
Thanks for following this issue.
#12
Closing until further communications.