Questions tagged [fragment-caching]
74 questions
3
votes
1 answer
Testing fragment creation and expire fragment in Rails (3.0.7)
I'm attempting to implement fragment caching in my application. It displays a lot of data that rarely changes so I figured that fragment caching would be the best solution for some performance problems I've been having.
I'm using Rail's built-in…

binarycleric
- 703
- 1
- 5
- 7
3
votes
1 answer
Rails 3.1 wildcard expire cache for action with query string
I have a page where on the where the index action shows a list of Posts, with custom sort columns, pagination, etc. Although I can cache every individual page / sort option with
cache(:direction => params[:direction], :sort => params[:sort], :page…

user545139
- 935
- 11
- 27
3
votes
5 answers
Caching a Drupal site with session-specific data on every page
We have a site written in Drupal 6.
We want to use Drupal's caching mechanism to improve performance, but when we turned it on, we found problems because our site has session data displayed on every page. Drupal's caching system only works for…

Spudley
- 166,037
- 39
- 233
- 307
3
votes
1 answer
Russian doll caching and permission-based links in view fragment
I've got a view that utilizes Russian Doll caching, where the whole collection of items is cached, and each item in the collection is cached individually within that cache.
However, each item in the collection should show edit/delete links based on…

K.C. Barrett
- 152
- 1
- 9
3
votes
1 answer
Rails avoiding queries with fragment caching on a basic show action
I'm playing with fragment caching, I have read the guides and watched the railscast.
I'm trying to make some fragment caching on a basic show action:
Controller:
class PostsController < ApplicationController
before_action :set_post, only:…

coding addicted
- 3,422
- 2
- 36
- 47
3
votes
4 answers
template fragment caching doesn't seem to work for some custom template tags
I've been implementing caching in my django application, and used per view caching via the cache API and template fragment caching.
On some of my pages I use a custom django template tag, this tag is provided via a third party developer, it takes…

Tristan Brotherton
- 2,533
- 7
- 32
- 38
2
votes
1 answer
Rails 3 caching: How do I use a sweeper with Action and Fragment caching to expire the cache?
I'm working on a page that displays a restaurant menu. I have 2 models: FoodMenu has_many :products and Product belongs_to :food_menu. I don't have controllers for either model. Instead, I am using a "pages_controller.rb" to display each FoodMenu…

monfresh
- 7,974
- 1
- 25
- 22
2
votes
1 answer
Fragment caching in rails
I am using fragment caching in rails 7 and encountering a issue . for reference, here is my view code which is views/users/index.html.erb
<%= notice %>
Users
<% cache "users_filter" do %> <%= render partial:…
Muhammad Ans
- 157
- 8
2
votes
1 answer
Is it possible to automatically derive the components of a cache-key in rails?
When generating cache-keys for rendered content in web applications, you have to take into account all variables that might change the result.
In dynamic environments like rails these can be defined in different places: the controller, a model, the…

odo
- 31
- 3
2
votes
1 answer
Working around memcached's lack of wildcard expiration in Rails fragment caching
I'm working on adding fragment caching to a Rails 3 site that has both logged in and anonymous users, and need to control when parts of the page expire based on when content displayed throughout the site is updated. Midway into this, I discovered…

Joost Schuur
- 4,417
- 2
- 24
- 39
2
votes
1 answer
rails leaving out some parts from fragment caching
I have a rails 4 app using pundit gem for authorization. If I do russian-doll fragment caching like the code below, the conditional statement used for authorization will be also cached, which is not good, since edit/delete buttons should only be…

Sean Magyar
- 2,360
- 1
- 25
- 57
2
votes
2 answers
rails 4 fragment caching for different views
In my rails 4 app I'm trying to take off with caching, but I'm a bit confused thanks to the different versions of cache-key-settings, cache helpers and auto-expiration.
So let me ask this through few examples. I don't move the examples to different…

Sean Magyar
- 2,360
- 1
- 25
- 57
2
votes
2 answers
Rails 4.2 fragment caching isn't working
I'm trying to fragment cache a static portion of my site, but it doesn't seem to be working at all. I've set up config/application.rb with the following:
config.action_controller.perform_caching = true
config.cache_store = :dalli_store
In my view,…

mrdziuban
- 749
- 3
- 11
- 23
2
votes
1 answer
Rails - Best way to implement Optionnal Fragment Caching for testing purposes
I'm using fragment caching a lot and it is essential to me for good performance. However, due to the complexity of the caching I'm using, I need to offer my testers, a way to disable/enable caching as a session variable. (On a user basis only)
I was…

user62605
- 185
- 1
- 10
2
votes
2 answers
How to keep caches warm using Russian Doll caching?
I've been experimenting with Russian Doll fragment caching on a Rails app, more specifically on its main Dashboard page. This is the first page the user sees after he logs in and is a great candidate for Russian Doll, since it contains many nested…

Luciano
- 825
- 1
- 7
- 10