Reduce cache times

This means content will be updated faster after changes
This commit is contained in:
Jake Howard 2023-06-26 13:26:28 +01:00
parent 0ac02231ad
commit c2150b66f3
Signed by: jake
GPG key ID: 57AFB45680EDD477
3 changed files with 3 additions and 3 deletions

View file

@ -27,6 +27,6 @@ class SingletonPageCache:
url = page.get_url(request) url = page.get_url(request)
cache.set(cache_key, url, 86400) cache.set(cache_key, url, 10800)
return url return url

View file

@ -12,7 +12,7 @@ from website.common.models import BasePage
from website.contrib.singleton_page.utils import SingletonPageCache from website.contrib.singleton_page.utils import SingletonPageCache
@django_cache_decorator(time=21600) @django_cache_decorator(time=600)
def get_latest_blog_post() -> Optional[Tuple[str, str]]: def get_latest_blog_post() -> Optional[Tuple[str, str]]:
from website.blog.models import BlogPostPage from website.blog.models import BlogPostPage

View file

@ -4,7 +4,7 @@ from django.http.request import HttpRequest
def global_vars(request: HttpRequest) -> dict: def global_vars(request: HttpRequest) -> dict:
# noop caching in preview # noop caching in preview
fragment_cache_ttl = 0 if getattr(request, "is_preview", False) else 21600 fragment_cache_ttl = 0 if getattr(request, "is_preview", False) else 3600
return { return {
"SEO_INDEX": settings.SEO_INDEX, "SEO_INDEX": settings.SEO_INDEX,
"DEBUG": settings.DEBUG, "DEBUG": settings.DEBUG,