Tokens and block cache

I have a form in a block that's being included in the footer of a website. The block had $btCacheBlockOutput set to true, but I guess that should be set to false, otherwise the token isn't renewed every request.

But, how does it work when Full Page Caching is enabled? Same problem, right?

I'm curious how other devs solve this problem. Disabling FPC just to generate a token seems wrong, and removing the token seems wrong too.


View Replies:
JohntheFish replied on at Permalink Reply
The full page cache will only cache pages where all blocks are cacheable (unless you tell it otherwise).

If you really need to fully cache the page, then you could either iframe or ajax load the part that cannot be cached. The disadvantage is that would no longer get indexed by Google.
A3020 replied on at Permalink Reply
Hm, okay, I'm gonna think about whether that token is really necessary for that block. Without FPC the site is not nearly as fast.

Thanks John.
ramonleenders replied on at Permalink Reply
Perhaps upgrade to a better/faster/newer hosting? There are lots of sites running on a "normal" priced hosting, instead of the cheapy slow ones. I have a couple of sites running on normal priced hosting and it runs perfectly fine. Full Page Caching set to "ON" will make it even faster of course, but you should be able to run without that.
A3020 replied on at Permalink Reply
The page is generated in 300ms, I think that's OK. But with FPC enabled this is reduced to < 100ms.