Forum: Typo cache mechanism in production mode

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Alex D. (Guest)
on 2007-05-15 14:02
(Received via mailing list)
I'm not very sure how the caching works with Typo, but it certainly
doesn't work the same if in production or development mode.

In development, everything works as expected; however, in production
mode, pages in cache don't expire when they should. I changed the
default template to show login/logout links, and the name of
whoever's logged in at the moment, and unless I clear the cache
manually, it shows the user as logged in even after he logs out, and
viceversa. Again, this only happens in production mode. If I disable
caching, things work fine.

Any insights?
Frederic de Villamil (Guest)
on 2007-05-15 15:23
(Received via mailing list)
Le 15 mai 07 à 12:02, Alex D. a écrit :

>
> Any insights?

2 points :
– there's no cache in dev mode.
– caching is caching and it won't clear when you change your
template, but only when you change the database, which is a tandard
behaviour. Do not consider Typo as a website but as a web
application, which means a different behaviour regarding things like
page generation or... caching.

Cheers,
Frédéric

--
Frédéric de Villamil
removed_email_address@domain.invalid                        tel: +33 (0)6 62 19 
1337
http://fredericdevillamil.com         Typo : http://typosphere.org
Alex D. (Guest)
on 2007-05-15 15:30
(Received via mailing list)
On May 15, 2007, at 2:23 PM, Frederic de Villamil wrote:

>> viceversa. Again, this only happens in production mode. If I disable
>> caching, things work fine.
>>
>> Any insights?
>
> 2 points :
> – there's no cache in dev mode.

That, I didn't know.

> – caching is caching and it won't clear when you change your
> template, but only when you change the database, which is a tandard
> behaviour. Do not consider Typo as a website but as a web
> application, which means a different behaviour regarding things like
> page generation or... caching.

I didn't mean to say that. I meant to say that I had made the
template to show session[:user], in order to test the caching. After
I did that, I noticed that regardless of the actual value in session
[:user], the same page was rendered. Indeed, session[:user] isn't
stored by Rails in the database, but in memory (afaik), but still it
doesn't seem right.

For Typo to consider that things like the session object do not
change between renderings -- and therefore trigger a cache flush --
actually makes it look more like a website (where everything is
considered as static, so it's ok to cache rendered pages)...
Piers C. (Guest)
on 2007-05-15 17:28
(Received via mailing list)
On 15/05/07, Alex D. <removed_email_address@domain.invalid> wrote:
>
> Any insights?

Yes. The pages got generated and pushed into the cache while you were
logged in. When you log out, you continue to look at pages that are in
the cache. You'll need to tweak things to populate the login/logout
and whoever's logged stuff via AJAX requests if you want it to
continue working.
Alex D. (Guest)
on 2007-05-15 17:31
(Received via mailing list)
Thank you. This question may be silly, but what if I wrote a sidebar
plugin for it? Would that still be cached?
Piers C. (Guest)
on 2007-05-15 18:22
(Received via mailing list)
On 15/05/07, Alex D. <removed_email_address@domain.invalid> wrote:
> Thank you. This question may be silly, but what if I wrote a sidebar
> plugin for it? Would that still be cached?

Yup. Unless it did an AJAXy type request.
This topic is locked and can not be replied to.