If I enable asset caching in CiviCRM everything works fine. If I disable it, the administration menu is gone from the top to a list that's beneath the page content and a lot of JS is broken too.

The reason for the broken JS (and maybe the broken CSS too), is (at least for some scripts) that in the files that are on my installation in /sites/default/files/css/ and /sites/default/files/js/ is somewhere in the middle of the JS code (and the css code) some PHP code, namely:


 * @file
 * The PHP page that serves all page requests on a Drupal installation.
 * The routines here dispatch control to the appropriate handler, which then
 * prints the appropriate page.
 * All Drupal code is released under the GNU General Public License.
 * See COPYRIGHT.txt and LICENSE.txt.

 * Root directory of Drupal installation.
define('DRUPAL_ROOT', getcwd());

require_once DRUPAL_ROOT . '/includes/bootstrap.inc';

When asset caching is enabled, there are different css and js files used, that are beneath the "image uplod url". And they seem to work properly.

I would like to disable asset caching, because I want to provide the images from a different server, so that they are loaded faster, to save bandwidth to our CiviCRM server and to have not so much load on the server, which has a lot of work, when sending mailings with images, tracking links and providing petitions by CiviCRM.

That asset caching is making use of the image uploud url, is imho not really intuitive, but thats a different story.

Does anybody have an idea what the reason is and how to solve this?

  • Maybe I should add, that this seems to be connected to the upgrade of Drupal core from 7.63 to 7.67 or views from 7.x-3.20 to 7.x-3.23. Jul 26, 2019 at 20:12
  • Does it look like this? civicrm.stackexchange.com/questions/30547/…
    – Demerit
    Jul 26, 2019 at 20:29
  • Well, yes it does in principle. Jul 26, 2019 at 20:34
  • Their solution sounds reasonable to me, if they use asset caching and if there was something wrong with the image upload url, because as I said, asset caching seems to use the image upload url to store css and js files. In my case everything works fine as long as asset caching is enabled and there is no difference, if I use absolute or relative image upload urls. Jul 26, 2019 at 20:40
  • 1
    Regarding the problem with the menu that is simply on the bottom of the page instead of being styled as a menu bar on top, I found out, that I get "@import url("my.domain.com/index.php?pv9pug");" instead the proper path to the css file with the styling information of the admin menu bar. So the css isn't broken because of this strange php code inside, but because it is not linked properly. The JS for example of the system status page brakes because of the php part. Jul 26, 2019 at 21:46


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.