diff --git a/app.rb b/app.rb
index d5f37947..808bcbb5 100644
--- a/app.rb
+++ b/app.rb
@@ -71,6 +71,12 @@ get '/stats_mockup' do
end
get '/?' do
+ if SimpleCache.expired?(:sites_count)
+ @sites_count = SimpleCache.store :sites_count, Site.count.roundup(100), 600 # 10 Minutes
+ else
+ @sites_count = SimpleCache.get :sites_count
+ end
+
erb :index, layout: false
end
diff --git a/environment.rb b/environment.rb
index eb4289a0..22654ad9 100644
--- a/environment.rb
+++ b/environment.rb
@@ -96,3 +96,13 @@ class Sinatra::Base
render_original engine, data, options, locals, &block
end
end
+
+class Numeric
+ def roundup(nearest=10)
+ self % nearest == 0 ? self : self + nearest - (self % nearest)
+ end
+
+ def rounddown(nearest=10)
+ self % nearest == 0 ? self : self - (self % nearest)
+ end
+end
\ No newline at end of file
diff --git a/models/simple_cache.rb b/models/simple_cache.rb
new file mode 100644
index 00000000..3c10ad57
--- /dev/null
+++ b/models/simple_cache.rb
@@ -0,0 +1,25 @@
+require 'thread'
+require 'time'
+
+module SimpleCache
+ @cache = {}
+ @semaphore = Mutex.new
+
+ class << self
+ def store(name, value, timeout=30)
+ @semaphore.synchronize {
+ @cache[name] = {value: value, expires_at: Time.now+timeout}
+ }
+ value
+ end
+
+ def get(name)
+ @cache[name][:value]
+ end
+
+ def expired?(name)
+ return false if @cache[name] && @cache[name][:expires_at] > Time.now
+ true
+ end
+ end
+end
\ No newline at end of file
diff --git a/views/_footer.erb b/views/_footer.erb
index 0b67007f..a40f674b 100644
--- a/views/_footer.erb
+++ b/views/_footer.erb
@@ -3,15 +3,17 @@
diff --git a/views/_header.erb b/views/_header.erb
index a755b9a9..b7c43963 100644
--- a/views/_header.erb
+++ b/views/_header.erb
@@ -7,9 +7,6 @@
- -
- Neocities
-
-
Websites
diff --git a/views/about.erb b/views/about.erb
index 76bf86d3..597398f3 100644
--- a/views/about.erb
+++ b/views/about.erb
@@ -14,7 +14,7 @@
- Neocities is bringing back the fun, creativity and free expression that made the web great.
+ Neocities is bringing back the fun, creativity and independence that made the web great.
We are tired of living in an online world where people are isolated from each other on boring web sites with generic templates defining what people are
@@ -43,7 +43,7 @@
PS: What are you waiting for? Go make your web site!
- Neocities is:
+ Neocities is:
- Helping the web. We are here to empower people to develop independent, creative sites.
- Free. We will always have a free web site option.
@@ -59,7 +59,7 @@
- The Neocities Team
+ The Neocities Team
diff --git a/views/index.erb b/views/index.erb
index 9a8e0557..68b4983a 100644
--- a/views/index.erb
+++ b/views/index.erb
@@ -5,7 +5,7 @@
-
Neocities.org: Social websites
+
Neocities: Create your free website now!
@@ -134,10 +134,9 @@
-
-
Social web building
+ Making the web fun again
- Browse, comment on, and follow the latest changes for any Neocities site!
-
+ We're community of over <%= @sites_count.to_s.reverse.gsub(/...(?=.)/,'\&,').reverse %> websites that are bringing back creative expression on the web. Anyone can make a site, only your imagination is required. Join us!
diff --git a/views/plan/index.erb b/views/plan/index.erb
index 6c1c88af..05ecbadf 100644
--- a/views/plan/index.erb
+++ b/views/plan/index.erb
@@ -6,7 +6,7 @@