mirror of
https://github.com/postgres/pgweb.git
synced 2025-08-13 13:12:42 +00:00
Enable cache-busting URLs for CSS and JS
This will allow us to increase the cache times in the browser for our CSS, which almost never changes. Enables a new value to be used in templates, {{gitrev}}, which can be used to bust pretty much any URL. We could do this for all the images in the templates as well, but since most of them almost never change, we'll just enable it manually for each individual image as it becomes necessray - or just use a ?1, ?2 etc for those. Enabled by default for CSS and JavaScript links, since those are much more likely to be changed without having the URL changed. Cache times aren't increased yet - we'll do that later one we're sure that all existing caches are expired first.
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
from django.shortcuts import render_to_response, get_object_or_404
|
||||
from django.http import HttpResponse, Http404, HttpResponseRedirect
|
||||
from django.template import TemplateDoesNotExist, loader, Context
|
||||
from django.template.context import RequestContext
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from django.db.models import Q
|
||||
from django.conf import settings
|
||||
@ -67,7 +68,7 @@ def docpage(request, version, typ, filename):
|
||||
'can_comment': (typ=="interactive" and ver==currver),
|
||||
'doc_index_filename': indexname,
|
||||
'loaddate': loaddate,
|
||||
})
|
||||
}, RequestContext(request))
|
||||
|
||||
def docsrootpage(request, version, typ):
|
||||
return docpage(request, version, typ, 'index')
|
||||
|
Reference in New Issue
Block a user