If you have the Advanced CSS/JS Aggregation module enabled, pagestyle doesn't work consistently. If you change style, and then go to a page that has not yet been cached, then the style changes. However, if you then visit a page that had been cached, the old style persists. The result is a mish-mash of pages styles for different pages as you change style on different pages.

CommentFileSizeAuthor
#3 1215888-pagestyle-cache.patch53.27 KBmrfelton

Comments

mrfelton’s picture

Note, this only seems to be an issue in Chrome.

mrfelton’s picture

Title: Pagestyle is incompatible with advagg module » Pagestyle doesn't wok with site cache enabled

Actually, this is completely unrelated to the advagg module. It's todo with having the site cache enabled. With site cache disabled everything works, with cache set to normal or aggressive, it doesn't. It just completely ignores the cookie.

mrfelton’s picture

Status: Active » Needs work
StatusFileSize
new53.27 KB

Attached is a patch that gets things working with the page cache enabled. The trick is to move some stuff into hook_boot, which is called for cached page loads. In order to make this work, I have to do away with the include files and move code into the main module file, since module_load_include is not available in hook_boot().

Patch isn't perfect as it takes an additional page load for stye changes to take effect, but at least you don't get stuck with some cached pages in one style and others in another.

mikeytown2’s picture

let me know if you need anything from me for advagg.

mrfelton’s picture

I don't think so Mike, but thanks. This is a problem with the Drupal core cache.

CZ’s picture

Status: Needs work » Needs review

Set the option "Scripting languages" to "Optimized for performance." and test it.

CZ’s picture

The patch is a big change and critical. I think it's now good for a release for now.

CZ’s picture

Status: Needs review » Fixed

Good, fixed in the developer version.

Status: Fixed » Closed (fixed)

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