Download & Extend

Table boost_cache fields size restrict the length of possible URLs

Project:Boost
Version:6.x-1.x-dev
Component:Caching logic
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

The schema definitions for boost_cache.filename and boost_cache.url are varchar[255], which restricts the length of a possible URL to that length.

My scenario is that I am using a long url to encode a sequence of 20 character ids for a JSON request, where there are often 20 or so ids. This is a hot spot on my site, and I've been using an old version of boost to manage it, but in upgrading to rc5, I can no longer use the module. Which is unfortunate, as it's very useful, and I was looking forward to limiting caching to particular pages (to keep my Who's Online anonymous stats reasonably accurate).

Is there a performance need for this? Neither of these fields are indexed...

Comments

#1

Title:Table boost_cache fields size have restricted the length of possible URLs» Table boost_cache fields size restrict the length of possible URLs

#2

BTW, for anyone googling, the clue for me was seeing Duplicate entry mysql errors in my logs.

And oops, yes, I now see filename is the primary key. Maybe an md5 hash would be better?

#3

I was guessing that 255 would be enough since url_alias is limited to 128. Here's some of my thoughts on this http://drupal.org/node/453426#comment-1693852

MD5 could work... just makes everything harder. Normalizing would be a better option; if going this route... which I think I am.
http://drupal.org/node/453908#comment-2020988

#4

You're quick!

Normalizing sounds good. Looking forward to it.

#5

filename and url both need to go in there correct? Also need to change the crawler since that's 255 as well... do you know if you can do unique rows on text, or does it have to be varchar?

Either way 1 new table called boost_lookup

UID - unique ID
URL - Text
Filename - Text (optional)

So when url's get loaded in the crawler from the url_alias table, filename is left blank.

#6

Actually, thinking about this... keep it simple. Just add on a MD5 Column to each table; make that the unique index; convert the varchar columns to text. I'll pass the MD5 around for the future planned views expiration stuff.

#7

Version:6.x-1.0-rc5» 6.x-1.x-dev
Priority:normal» critical

next thing that needs to be done

#8

Status:active» needs review
AttachmentSize
boost-575386.patch 17.42 KB

#9

added 1 more update function

AttachmentSize
boost-575386.1.patch 17.85 KB

#10

Fixed Column count doesn't match value count on line 1499.

AttachmentSize
boost-575386.2.patch 17.88 KB

#11

Status:needs review» fixed

committed

#12

Status:fixed» closed (fixed)

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

nobody click here