Multi-db typo cache problems

Hi!

I’m using typo on Lighttpd + FastCGI (recent snapshot, namely r762). It
serves more than one db, using the trick described at

http://sg.validcode.at/articles/2005/12/04/how-to-host-multiple-blogs-with-on-typo-installation

I had to disable caching, because Typo reuses the cache contents
regardless of switching between blogs, so you get one blogger’s blog
when you’d like to see the blog of another one. Even so, parts of blog
content (eg., title/subtitle field) will be slightly mixed when asking
for one’s blog after the other’s, and the real blog will be seen only
after a browser refresh. (Notes here:

  • no, it’s not browser cache, I tested with two distinct browser
    instances;
  • if I had caching enabled, browser refresh wouldn’t help either.

)

Moreover, if I ask for a nonexistent blog (db table) foo (via the
appropriate subdomain), I get a mysql error. That’s OK, but from that on
Typo just keeps on whining that “can’t connect database foo” (even if I
want to access existing blogs). (Yeah, as a workaround I can get the
webserver allow only subdomains where there is an existing blog, but I’d
prefer to keep config orthogonal, that is, there should be exactly one
thing to modify in order to add a new blog, ie. add a new MySQL table).

Can you give me advice how to solve these?

Regards,
Csaba

On 2006-03-15, Csaba H. [email protected] wrote:

I’m using typo on Lighttpd + FastCGI (recent snapshot, namely r762). It

And it’s r876. Why on earth do I see “Typo r762” at the bottom of the
admin interface?

Regards,
Csaba

Wow, this one’s new to me.
The cache should work if you’re using a version of Typo new enoughto
use the action cache. The hostname should be part of the cachekey.
Take a look at vendor/plugins/expiring_action_cache and add
somedebugging code to see what’s happening.
Frankly, the multi-blog DB connect code in that post is kind ofhideous.
It needs more error checking, and it really ought to cacheDB connections
or something–as it is, it looks like it’ll do a newconnection for every
hit.
There are a couple people working on moving multi-blog support intothe
core of Typo, but I don’t know when we’ll see working code–itmight be
today, it might be next year.

Scott
On 3/15/06, Csaba H. [email protected] wrote:> Hi!>> I’m using typo
on Lighttpd + FastCGI (recent snapshot, namely r762). It> serves more
than one db, using the trick described at>>
http://sg.validcode.at/articles/2005/12/04/how-to-host-multiple-blogs-with-on-typo-installation>>
I had to disable caching, because Typo reuses the cache contents>
regardless of switching between blogs, so you get one blogger’s blog>
when you’d like to see the blog of another one. Even so, parts of blog>
content (eg., title/subtitle field) will be slightly mixed when asking>
for one’s blog after the other’s, and the real blog will be seen only>
after a browser refresh. (Notes here:>> - no, it’s not browser cache,
I tested with two distinct browser> instances;> - if I had caching
enabled, browser refresh wouldn’t help either.>> )>> Moreover, if I ask
for a nonexistent blog (db table) foo (via the> appropriate subdomain),
I get a mysql error. That’s OK, but from that on> Typo just keep!
s on whining that “can’t connect database foo” (even if I> want to
access existing blogs). (Yeah, as a workaround I can get the> webserver
allow only subdomains where there is an existing blog, but I’d> prefer
to keep config orthogonal, that is, there should be exactly one> thing
to modify in order to add a new blog, ie. add a new MySQL table).>> Can
you give me advice how to solve these?>> Regards,> Csaba>>
_______________________________________________> Typo-list mailing list>
[email protected]>
http://rubyforge.org/mailman/listinfo/typo-list>

On 2006-03-15, Scott L. [email protected] wrote:

Wow, this one’s new to me. The cache should work if you’re using a
version of Typo new enoughto use the action cache. The hostname
should be part of the cachekey. Take a look at
vendor/plugins/expiring_action_cache and add somedebugging code to see
what’s happening.

I see. I don’t have time for debugging it now (I hoped I can get along
with
utilizing someone’s expertise :)). I’ll look back when I get to the
point
that I can devote time for it.

Frankly, the multi-blog DB connect code in that
post is kind ofhideous. It needs more error checking, and it really
ought to cacheDB connections or something–as it is, it looks like
it’ll do a newconnection for every hit.

Yeah, that’s pathetic…

There are a couple people
working on moving multi-blog support intothe core of Typo, but I don’t
know when we’ll see working code–itmight be today, it might be next
year.

I hope for the best…

Thanks for the answers, I at least have some picture now :slight_smile:

Regards,
Csaba

The version string is broken. It’s been fixed, sort of, in newer
versions.

Scott
On 3/15/06, Csaba H. [email protected] wrote:> On 2006-03-15, Csaba
Henk [email protected] wrote:> > I’m using typo on Lighttpd + FastCGI
(recent snapshot, namely r762). It>> And it’s r876. Why on earth do I
see “Typo r762” at the bottom of the> admin interface?>> Regards,>
Csaba>> _______________________________________________> Typo-list
mailing list> [email protected]>
http://rubyforge.org/mailman/listinfo/typo-list>