Permalink
Browse files

Removed caching as now going to implement dynamic views for mobile de…

…vices and also and administration system
  • Loading branch information...
1 parent e412229 commit fd670352e64a6ba573b2be85b43d417a86cf8920 Dan Watson committed Nov 2, 2011
View
@@ -2,7 +2,6 @@ source "http://rubygems.org/"
gem "sqlite3-ruby"
gem "sinatra"
-gem "sinatra-cache"
gem "datamapper"
gem "haml"
gem "akismetor"
View
@@ -107,11 +107,6 @@ GEM
rack (~> 1.3, >= 1.3.4)
rack-protection (~> 1.1, >= 1.1.2)
tilt (~> 1.3, >= 1.3.3)
- sinatra-cache (0.3.7)
- sinatra (>= 1.1.0)
- sinatra-outputbuffer (>= 0.1.0)
- sinatra-outputbuffer (0.1.0)
- sinatra (>= 1.0.a)
sqlite3 (1.3.4)
sqlite3-ruby (1.3.3)
sqlite3 (>= 1.3.3)
@@ -141,5 +136,4 @@ DEPENDENCIES
rspec
shotgun
sinatra
- sinatra-cache
sqlite3-ruby
View
@@ -18,12 +18,6 @@ Runs the site on test data (bundler must be installed)
Deploy shout mouth to your server and browse to http://yourblog.com and follow the on screen instructions
===Rake Tasks
- rake cache:clear (Clear The Cache)
-
- rake cache:prime (Prime The Cache)
-
- rake cache:create (Create The Cache Folder With The Correct Permissions)
-
rake db:create (Create The Database)
rake db:delete (Delete Database)
@@ -1,13 +0,0 @@
-class CacheCleaner
- def self.clear_cache
- FileUtils.rm_rf(Dir.glob("#{cache_path}/*"))
- end
-
- def self.cache_path
- File.join(File.dirname(__FILE__) , "..", "..", "..", "public", "cache")
- end
-
- def self.clear_cache_for page, type = "html"
- FileUtils.rm_rf(File.join(cache_path, "#{page.to_s}.#{type}"))
- end
-end
View
@@ -19,7 +19,6 @@ def self.posts_on_home_page
def self.posts_on_home_page=(value)
create_or_update 'posts_on_home_page', value.to_i
- CacheCleaner.clear_cache_for 'index'
end
#----------------------------#
def self.url
@@ -28,7 +27,6 @@ def self.url
def self.url=(value)
create_or_update 'url', value
- CacheCleaner.clear_cache
end
#----------------------------#
def self.akismet_key
@@ -77,7 +75,6 @@ def self.theme
def self.theme=(value)
create_or_update 'theme', value
- CacheCleaner.clear_cache
end
#----------------------------#
def self.site_name
@@ -86,7 +83,6 @@ def self.site_name
def self.site_name=(value)
create_or_update 'site_name', value
- CacheCleaner.clear_cache
end
#----------------------------#
def self.site_description
@@ -95,7 +91,6 @@ def self.site_description
def self.site_description=(value)
create_or_update 'site_description', value
- CacheCleaner.clear_cache
end
#----------------------------#
def self.twitter_account
@@ -104,7 +99,6 @@ def self.twitter_account
def self.twitter_account=(value)
create_or_update 'twitter_account', value
- CacheCleaner.clear_cache
end
#----------------------------#
def self.check_spam
@@ -121,7 +115,6 @@ def self.comments_open_for_days
def self.comments_open_for_days=(value)
create_or_update 'comments_open_for_days', value.to_i
- CacheCleaner.clear_cache
end
#----------------------------#
def self.use_file_based_storage
@@ -138,7 +131,6 @@ def self.footer_more_text
def self.footer_more_text=(value)
create_or_update 'footer_more_text', value
- CacheCleaner.clear_cache
end
#----------------------------#
def self.google_analytics_key
@@ -147,7 +139,6 @@ def self.google_analytics_key
def self.google_analytics_key=(value)
create_or_update 'google_analytics_key', value
- CacheCleaner.clear_cache
end
#----------------------------#
def self.use_google_analytics
View
@@ -10,7 +10,6 @@ class Category
before :save do
self.persisted_slug = self.slug
- CacheCleaner.clear_cache
end
#Instance Methods
View
@@ -22,7 +22,6 @@ class Comment
before :save do
Blog.check_spam ? self.is_spam = spam? : self.is_spam = false
- CacheCleaner.clear_cache_for self.post.link
end
#Instance Methods
View
@@ -26,7 +26,6 @@ class Post
self.persisted_slug = self.slug
self.month = created_at.strftime("%B")
self.year = created_at.year
- CacheCleaner.clear_cache
end
def parent_page
View
@@ -12,7 +12,6 @@ class Tag
before :save do
self.persisted_slug = self.slug
- CacheCleaner.clear_cache
end
#Instance Methods
View
@@ -15,10 +15,6 @@ class User
has n, :posts
- before :save do
- CacheCleaner.clear_cache
- end
-
#Constructor
def initialize(attributes = nil)
super(attributes)
View
@@ -1,6 +1,5 @@
require 'rubygems'
require 'sinatra'
-require 'sinatra/cache'
require 'pony'
require 'haml'
require 'json'
@@ -21,7 +20,6 @@
require Dir.pwd + '/app/lib/hash'
require Dir.pwd + '/app/lib/regexp'
require Dir.pwd + '/app/api/plugin/plugin_factory'
-require Dir.pwd + '/app/api/cache/cache_cleaner'
require Dir.pwd + '/app/api/command/command_handler'
require Dir.pwd + '/app/api/mobile_detector/mobile_detector'
@@ -35,11 +33,6 @@ class ShoutMouth < Sinatra::Base
set :views, File.dirname(__FILE__) + '/views'
set :root, File.dirname(__FILE__)
- #Cache Setup
- register(Sinatra::Cache)
- set :cache_enabled, true
- set :cache_output_dir, Proc.new { File.join(public_folder,'cache') }
-
get '/' do
begin
@@ -210,18 +203,6 @@ class ShoutMouth < Sinatra::Base
haml :not_found
end
- after do
- if response && response.status.to_i == 404
- #Dont bother caching the 404's because the webserver will not render the correct status code....
- #Breaking the cache from the gem does not work - Manual deletion
- file = request.env["PATH_INFO"].to_s
- cached_file = File.join(File.dirname(__FILE__), "..", "public", "cache", file)
- cached_file += ".html" if File.extname(cached_file) == ''
- FileUtils.rm_rf(cached_file)
- end
- end
-
-
#----------------------------------------------------------------------------------#
#-------------Metaweblog/Blogger/WordPress API-------------------------------------#
#------send: see methods in the metaweblog api module------------------------------#
View
@@ -6,7 +6,6 @@
= partial(:'shared/_scripts')
= partial(:'shared/_discovery')
%body
- = cache_timestamp
#container
#header
= partial(:'shared/_header')

0 comments on commit fd67035

Please sign in to comment.