I'm having an issue getting Boost to cache panels pages that have url variables at the end, specifically the paging variable page=0%2C1 generated from using a pager with views. I have the option in the settings page turned on to cache pages with url variables but the panels pages with url variables don't seem to be getting cached. All other pages/content are being cached correctly by Boost.

Comments

mikeytown2’s picture

page=0,1
Turn verbose to level 9 and try to cache the page. If it doesn't cache, turn off "Only allow ASCII characters in path" and try again. Let me know what the dblog shows in both cases.

atracht’s picture

It appears Boost is caching the non comma escaped version of the url string, so page=0,1 gets cached when the url shows page=0%2C1

Since the paging links still remain page=0%2C1 the cached version is not shown unless page=0,1 is typed in manually in the address bar.

Is this a specific issue with Boost or is there an issue I'm having with Drupal escaping certain characters in url strings?

Here's the output of the debug first with only ascii characters on, then with the setting off.

Location
http://localhost/drupal/news?page=0%2C0
Referrer
http://localhost/drupal/news?page=0%2C1
Message
Debug: _boost_ob_handler() 
HTTP Info: 200 - text/html 
Path: cache/normal/localhost/drupal/news_page=0,0.html 
Content Container: page_manager_page_execute 
Content Type: news 
ID: 3 
Cache This: TRUE.

Location
http://localhost/drupal/news?page=0%2C0
Referrer
http://localhost/drupal/news?page=0%2C1
Message
Debug: _boost_ob_handler() 
HTTP Info: 200 - text/html 
Path: cache/normal/localhost/drupal/news_page=0,0.html 
Content Container: page_manager_page_execute 
Content Type: news 
ID: 3 
Cache This: TRUE.
mikeytown2’s picture

Component: Caching logic » Apache integration

Sounds like to do this correctly I need to save both versions of the html; one with url encoded strings, one without url encoded strings. This is an apache issue; it appears that apache is looking for a file that contains %2C instead of a file that contains ,. To verify my hypothesis would you mind copying news_page=0,0.html to news_page=0%2C0.html and see if the cached version gets served.

atracht’s picture

When copying news_page=0,0.html to news_page=0%2C0.html the cached version gets served.

mikeytown2’s picture

Title: Panels paging url variables not being cached » Percent encoding issue with Apache - URL variables not being cached.
Version: 6.x-1.15 » 6.x-1.x-dev
Category: support » bug
mikeytown2’s picture

Need to make a function that will output a list of potential filenames given the input and settings; otherwise this is going to get unmanageable.

First step is to apply urlencode() to the filename, if it's different then save that copy as well. Internally they are already urldecoded. After that apply gzip if wanted.

mikeytown2’s picture

Status: Active » Needs review
StatusFileSize
new9.54 KB
mikeytown2’s picture

StatusFileSize
new9.54 KB

WRONG FILE

mikeytown2’s picture

StatusFileSize
new10.56 KB
mikeytown2’s picture

Status: Needs review » Fixed

committed

atracht’s picture

Status: Fixed » Active

After applying the patch it appears that Apache still isn't serving the cached file. The page is being saved as news_page%3D0%2C0.html but will only show up if renamed to news_page=0%2C0.html It looks like the equal sign being encoded is causing the problem.

mikeytown2’s picture

Status: Active » Needs review
StatusFileSize
new1.01 KB

thanks for pointing that out; try this patch, hopefully this does it. I may want to be selective and only encode certain characters instead of doing it this way.

atracht’s picture

The last patch seems to fix it for me. The cached pages are now being served. Thanks!

mikeytown2’s picture

Status: Needs review » Fixed

Thanks for testing. Committed.

Status: Fixed » Closed (fixed)

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