Question

Excerpt from the Rails documentation:

One of the issues with Page Caching is that you cannot use it for pages that require to restrict access somehow. [...]

What does "restrict access" exactly mean? Can you give me some examples?

Does it refer to, for example, Wikis and forums?

Was it helpful?

Solution

Whenever you have an auth system like the first commenter said.

Wiki's could be cached. Forums shouldn't be cached if they are fairly active as you want your users to see the fresh content every time they visit

Also watch out for flash messages. As an example a user fills out a form and you flash "Success thanks for registering" when you render the home page. You wouldn't want that message to appear to the user the next time he visits your page.

Watch the Railscasts Dynamic Page Caching episode for lots of great information and potential problems you may run into. http://railscasts.com/episodes/169-dynamic-page-caching-revised

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top