Perfomance Flashcards
What is view caching?
It allows you to cache some pages.
What is Page caching?
Page caching store the whole page on your disk.
What is Action caching?
Page Caching cannot be used for actions that have before filters - for example, pages that require authentication. This is where Action Caching comes in.
What is Fragment caching?
Fragment Caching allows a fragment of view logic to be wrapped in a cache block and served out of the cache store when the next request comes in.
When your application receives its first request to this page,
Rails will write a new cache entry with a unique key. (with update_at timestamp)
Where we can store cached data?
1) FileStory
2) MemoryStory
3) MemCacheStore
4) RedisCacheStore
What is Counter Cashe?
The counter cache, on the other hand, stores the number of records of each associated object in its own column in the database (We need to add a new column). This value can be retrieved as often as is needed, without requiring potentially expensive computation to take place.
How to disable DB caching for ActiveRecord query request?
Company.all.select(“SQL_NO_CACHE *”)