Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
Nuovo sito
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
16
Issues
16
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gruppo Web
Nuovo sito
Commits
f1b74f6a
Commit
f1b74f6a
authored
Dec 20, 2015
by
Pietro Albini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed errors in cache.py and removed unused parts
parent
1f3db333
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
10 deletions
+3
-10
uitwww/cache.py
uitwww/cache.py
+3
-10
No files found.
uitwww/cache.py
View file @
f1b74f6a
...
...
@@ -29,7 +29,7 @@ def enable(func):
def
remove
(
path
,
recursive
=
False
):
"""Remove a path from the cache"""
app
=
flask
.
current_app
path
=
os
.
path
.
join
(
app
.
c
ache_path
,
path
)
path
=
os
.
path
.
join
(
app
.
c
onfig
[
"CACHE_PATH"
]
,
path
)
try
:
if
os
.
path
.
isdir
(
path
):
...
...
@@ -66,11 +66,11 @@ def after_request(response):
if
status
!=
200
or
method
!=
"GET"
:
return
result
# Normalize the page url
if
url
.
endswith
(
"/"
):
url
+=
"index.html"
el
se
:
el
if
"."
not
in
url
:
url
+=
".html"
if
url
.
startswith
(
"/"
):
url
=
url
[
1
:]
# Remove / at the start
...
...
@@ -82,13 +82,6 @@ def after_request(response):
return
response
def
before_request
():
"""Hook meant to be executed before a request"""
# TODO: implement the cache
pass
def
install_cache
(
app
):
"""Install the cache on a specific app"""
app
.
before_request
(
before_request
)
app
.
after_request
(
after_request
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment