Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hypha
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ots
hypha
Commits
4a371911
Commit
4a371911
authored
5 years ago
by
Parbhat Puri
Browse files
Options
Downloads
Patches
Plain Diff
Remove unsed code which add maxage cache control response header
parent
47033890
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
opentech/urls.py
+0
-17
0 additions, 17 deletions
opentech/urls.py
with
0 additions
and
17 deletions
opentech/urls.py
+
0
−
17
View file @
4a371911
from
django.conf
import
settings
from
django.conf
import
settings
from
django.urls
import
include
,
path
from
django.urls
import
include
,
path
from
django.contrib
import
admin
from
django.contrib
import
admin
from
django.views.decorators.cache
import
cache_control
from
django.views.generic
import
TemplateView
from
django.views.generic
import
TemplateView
from
django.conf.urls
import
url
from
django.conf.urls
import
url
from
wagtail.utils.urlpatterns
import
decorate_urlpatterns
from
wagtail.contrib.sitemaps.views
import
sitemap
from
wagtail.contrib.sitemaps.views
import
sitemap
from
wagtail.admin
import
urls
as
wagtailadmin_urls
from
wagtail.admin
import
urls
as
wagtailadmin_urls
from
wagtail.core
import
urls
as
wagtail_urls
from
wagtail.core
import
urls
as
wagtail_urls
...
@@ -16,19 +14,6 @@ from opentech.public import urls as public_urls
...
@@ -16,19 +14,6 @@ from opentech.public import urls as public_urls
from
opentech.apply.users.urls
import
public_urlpatterns
as
user_urls
from
opentech.apply.users.urls
import
public_urlpatterns
as
user_urls
def
apply_cache_control
(
*
patterns
):
# Cache-control
cache_length
=
getattr
(
settings
,
'
CACHE_CONTROL_MAX_AGE
'
,
None
)
if
cache_length
:
patterns
=
decorate_urlpatterns
(
patterns
,
cache_control
(
max_age
=
cache_length
)
)
return
list
(
patterns
)
urlpatterns
=
[
urlpatterns
=
[
path
(
'
django-admin/
'
,
admin
.
site
.
urls
),
path
(
'
django-admin/
'
,
admin
.
site
.
urls
),
path
(
'
admin/
'
,
include
(
wagtailadmin_urls
)),
path
(
'
admin/
'
,
include
(
wagtailadmin_urls
)),
...
@@ -71,8 +56,6 @@ urlpatterns += [
...
@@ -71,8 +56,6 @@ urlpatterns += [
path
(
''
,
include
(
wagtail_urls
)),
path
(
''
,
include
(
wagtail_urls
)),
]
]
urlpatterns
=
apply_cache_control
(
*
urlpatterns
)
if
settings
.
DEBUG
and
settings
.
DEBUGTOOLBAR
:
if
settings
.
DEBUG
and
settings
.
DEBUGTOOLBAR
:
import
debug_toolbar
import
debug_toolbar
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment