Commit b6ce94c5 authored by David Haynes's avatar David Haynes 🙆

Merge branch '39-pagecacheing' into '2.2-dev'

Resolve "Page cacheing static pages"

See merge request !77
parents cd3fbef5 9edc9e22
Pipeline #935 passed with stage
in 1 minute and 29 seconds
......@@ -168,3 +168,10 @@ EMAIL_TO = "to@example.com"
# Domain used to email to users. See line 231 in views.py
# ie. in Mason's case '@masonlive.gmu.edu'
EMAIL_DOMAIN = os.environ['email_domain']
# dummy cache for development-- doesn't actually cache things
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
}
}
......@@ -179,3 +179,14 @@ EMAIL_TO = "to@example.com"
# Domain used to email to users. See line 231 in views.py
# ie. in Mason's case '@masonlive.gmu.edu'
EMAIL_DOMAIN = "@example.com"
# Use redis cache when not in local development
if DEBUG:
pass
else:
CACHES = {
'default': {
'BACKEND': 'redis_cache.RedisCache',
'LOCATION': '/var/run/redis/redis.sock',
},
}
......@@ -6,6 +6,7 @@ from django.conf.urls import include, url
import django.contrib.auth.views
from django.contrib import admin
from django.conf import settings
from django.views.decorators.cache import cache_page
from django.views.generic import TemplateView
# App Imports
......@@ -17,27 +18,27 @@ admin.autodiscover()
# Main list of project URL's
urlpatterns = [
# / - Homepage url.
url(r'^$', go.views.index, name='index'),
# / - Homepage url. Cached for 1 second (this is the page you see after logging in, so having it show as not logged in is strange)
url(r'^$', cache_page(1)(go.views.index), name='index'),
# /view/<short> - View URL data.
url(r'^view/(?P<short>[-\w]+)$', go.views.view, name='view'),
# /view/<short> - View URL data. Cached for 15 minutes
url(r'^view/(?P<short>[-\w]+)$', cache_page(60*15)(go.views.view), name='view'),
# /about - About page.
url(r'^about/?$', TemplateView.as_view(template_name='core/about.html'),
# /about - About page. Cached for 15 minutes
url(r'^about/?$', cache_page(60*15)(TemplateView.as_view(template_name='core/about.html')),
name='about'),
# /signup - Signup page for access.
url(r'^signup/?$', go.views.signup, name='signup'),
# /signup - Signup page for access. Cached for 15 minutes
url(r'^signup/?$', cache_page(60*15)(go.views.signup), name='signup'),
# /myLinks - My-Links page, view and review links.
url(r'^myLinks/?$', go.views.my_links, name='my_links'),
# /myLinks - My-Links page, view and review links. Cached for 5 seconds
url(r'^myLinks/?$', cache_page(5)(go.views.my_links), name='my_links'),
# /delete/<short> - Delete a link, no content display.
url(r'^delete/(?P<short>[-\w]+)$', go.views.delete, name='delete'),
# /registered - registration complete page
url(r'^registered/?$', TemplateView.as_view(template_name='registered.html'),
# /registered - registration complete page. Cached for 15 minutes
url(r'^registered/?$', cache_page(60*15)(TemplateView.as_view(template_name='registered.html')),
name='registered'),
# /admin - Administrator interface.
......
Django==1.10
django-crispy-forms==1.6.0
django-ratelimit==1.0.1
django-redis-cache==1.6.4
git+https://github.com/bruno207/django-qrcode.git
git+https://github.com/kstateome/django-cas.git
git+https://github.com/bruno207/django-bootstrap3-datetimepicker.git
hashids==1.1.0
mysqlclient
redis==2.10.5
requests==2.11.0
simplejson==3.8.2
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment