Here's a problem I just found: URLs on my website all end in .html. This is translated into _html in the filename, and Apache apparently doesn't find that file. So now only the frontpage and a few special pages are actually retrieved from the cache.

Why does the period even have to be translated for the filename? A file something.html.html is no problem and would solve this issue.

CommentFileSizeAuthor
#4 boost-180689.patch437 bytesHetta

Comments

Hetta’s picture

Same for me: boost works fine for taxonomy terms, but content called up with *.html doesn't show the <!-- Page cached by Boost at 2007-10-04 08:46:40, expires at 2007-10-05 08:46:40 --> in the html source.

All pages are cached on the hard drive.

That's using the latest dev version, downloaded today.

(Sorry, I couldn't find the place where "." is preg_replaced to "_" in the code.)

Hetta’s picture

I've read and re-read the boost code, and I really can't see where the "*.html" (of the url_alias) is changed to "_html", before boost adds ".html" and writes things to the hard drive.

I'd love to see where that's done, though. Help?

Thanks!

eagereyes’s picture

Got it! This line in boost.api.inc:
$path = preg_replace('@[^/a-z0-9_-]@i', '_', $path);
needs to get the period added to the list of exceptions:
$path = preg_replace('@[^./a-z0-9_-]@i', '_', $path);
Works wonderfully now!

Can somebody make this into a patch to get it included into the module?

Hetta’s picture

Version: 5.x-1.0 » 5.x-1.x-dev
Status: Active » Reviewed & tested by the community
StatusFileSize
new437 bytes

Thanks! Here's the patch, against .dev.

vivekkhera’s picture

Don't you need to escape the "." as "\." to prevent it from matching all characters? You've effectively neutered the regexp so it doesn't replace anything, except perhaps newlines, haven't you?

oliver soell’s picture

not in this case: inside character classes, . is considered a literal.
-o

Arto’s picture

Title: Caching does not work for URLs ending in .html » Does not work for URL aliases ending in .html
Assigned: Unassigned » Arto

Looking into this.

federico’s picture

Patched against dev ant still doesn't work for me.

I think this issue should be mentioned in readme.txt because it can actually "unboost" your site if you use a lot of aliases ending with "html". Every request for a page with alias ending in "html" writes a watchdog error symlink() [<a href='function.symlink'>function.symlink</a>]: File exists en la línea 83 del archivo /var/www/site/sites/all/modules/boost/boost.helpers.inc.", and in my case this causes a higher response time and server load than without boost.

andreiashu’s picture

For me this solution at #4 worked just fine in 6.x version.
@federico: those watchdog messages appear only with the mentioned patch ? Try to clear the cache after applying it. I don't have any idea for your problem, for me the patch works flawlessly.

federico’s picture

OK, I installed everything again and applied patch again and it works fine!!! Thanks! Maybe last time i applied the path in a wrong way.

memtkmcc’s picture

resolved

mikeytown2’s picture

Status: Reviewed & tested by the community » Closed (fixed)

Closing all 5.x issues; will only reevaluate if someone steps up #454652: Looking for a co-maintainer - 5.x

Reason is 6.x has 10x as many users as 5.x; also last 5.x dev was over a year ago. The 5.x issue queue needs to go.