Permalink
Browse files

removing caching, replacing with varnishd aware headers

  • Loading branch information...
mcansky committed May 17, 2011
1 parent f057dad commit a8dbdda27b8a0af1418365d3a67d9fc53314c49b
@@ -1,7 +1,6 @@
class GroupsController < ApplicationController
before_filter :authenticate_user!, :except => ["index", "show"]
authorize_resource :class => "Group"
- cache_sweeper :group_sweeper
def index
groups = nil
@@ -9,9 +9,9 @@ class PostsController < ApplicationController
# auth needed !x
before_filter :authenticate_user!, :except => "index"
authorize_resource :class => "Bookmark"
- cache_sweeper :bookmark_sweeper
-
+
def index
+ response.headers['Cache-Control'] = 'public, max-age=240'
# testing some params
user = nil
if params[:username]
View
@@ -21,24 +21,20 @@
- if (params[:tag] || params[:username] || params[:fromdt] || params[:todt] || params[:page])
- if current_user
- - cache(:fragment => params.to_s + "_#{current_user.id}_posts", :expires_in => 10.minute) do
- = render "posts/posts_short", :posts => @posts
+ = render "posts/posts_short", :posts => @posts
.pagination
= will_paginate(@posts)
- else
- - cache(:fragment => params.to_s + "_#{current_user.id}_posts", :expires_in => 10.minute) do
- = render "posts/posts_short", :posts => @posts
+ = render "posts/posts_short", :posts => @posts
.pagination
= will_paginate(@posts)
- else
- if current_user
- - cache(:fragment => "all_user_#{current_user.id}_posts", :expires_in => 3.minute) do
- = render "posts/posts_short", :posts => @posts
+ = render "posts/posts_short", :posts => @posts
.pagination
= will_paginate(@posts)
- else
- - cache(:fragment => "public_all_posts", :expires_in => 3.minute) do
- = render "posts/posts_short", :posts => @posts
+ = render "posts/posts_short", :posts => @posts
.pagination
= will_paginate(@posts)
.clear
View
@@ -1,12 +1,11 @@
%div
- - cache(:action => 'index', :action_suffix => 'stats', :expires_in => 12.hour) do
- %h1 Stats
- %h2 Bookmarks
- #stats_bookmarks{:style => "width:570px;height:300px;"}
- %h2 Tags
- #stats_tags{:style => "width:570px;height:300px;"}
- %h2 Users
- #stats_users{:style => "width:570px;height:300px;"}
- .clear
- =javascript_include_tag "stats"
+ %h1 Stats
+ %h2 Bookmarks
+ #stats_bookmarks{:style => "width:570px;height:300px;"}
+ %h2 Tags
+ #stats_tags{:style => "width:570px;height:300px;"}
+ %h2 Users
+ #stats_users{:style => "width:570px;height:300px;"}
+ .clear
+ =javascript_include_tag "stats"

0 comments on commit a8dbdda

Please sign in to comment.