Commit c2bb849f authored by Romain Casati's avatar Romain Casati
Browse files

Fix cache issues with cache busting via query string.

parent a1279f89
......@@ -2,7 +2,7 @@ image: debian:buster
pages:
script:
- apt-get update && apt-get -y install make python3 python3-setuptools python3-pip nodejs npm git tar zip
- apt-get update && apt-get -y install make python3 python3-setuptools python3-pip python3-jinja2 nodejs npm git tar zip
- make build
- make archives
- mv build/lib/notebook public
......
......@@ -16,8 +16,8 @@ install-kernel: _install-kernel version
build: clean install-kernel
python3 setup.py build
for f in version custom api/ kernelspecs/ basthon/ examples/; do cp -r notebook/$$f build/lib/notebook/; done
mv build/lib/notebook/basthon/* build/lib/notebook/
for f in version custom api/ kernelspecs/ examples/; do cp -r notebook/$$f build/lib/notebook/; done
python3 index_renderer.py build/lib/notebook/index.html
archives:
tar --exclude="*.htaccess" -czf basthon-notebook.tgz -C build/lib/notebook/ .
......
from jinja2 import Environment, FileSystemLoader, select_autoescape
import time
import sys
env = Environment(
loader=FileSystemLoader('notebook/basthon/'),
autoescape=select_autoescape(['html'])
)
index = env.get_template('index.template.html')
index = index.render(BASTHON_CACHE_BUSTING_TIMESTAMP=int(time.time()))
with open(sys.argv[1], 'w') as f:
f.write(index)
......@@ -5,38 +5,38 @@
<meta charset="utf-8">
<title>Basthon Notebook</title>
<link id="favicon" rel="shortcut icon" type="image/x-icon" href="static/base/images/favicon-notebook.ico">
<link id="favicon" rel="shortcut icon" type="image/x-icon" href="static/base/images/favicon-notebook.ico?v={{BASTHON_CACHE_BUSTING_TIMESTAMP}}">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="stylesheet" href="static/components/jquery-ui/themes/smoothness/jquery-ui.min.css" type="text/css" />
<link rel="stylesheet" href="static/components/jquery-typeahead/dist/jquery.typeahead.min.css" type="text/css" />
<link rel="stylesheet" href="static/components/jquery-ui/themes/smoothness/jquery-ui.min.css?v={{BASTHON_CACHE_BUSTING_TIMESTAMP}}" type="text/css" />
<link rel="stylesheet" href="static/components/jquery-typeahead/dist/jquery.typeahead.min.css?v={{BASTHON_CACHE_BUSTING_TIMESTAMP}}" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script type="text/javascript" src="static/components/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML-full,Safe&delayStartupUntil=configured" charset="utf-8"></script>
<script type="text/javascript" src="static/components/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML-full,Safe&delayStartupUntil=configured&v={{BASTHON_CACHE_BUSTING_TIMESTAMP}}" charset="utf-8"></script>
<script type="text/javascript">
// MathJax disabled, set as null to distinguish from *missing* MathJax,
// where it will be undefined, and should prompt a dialog later.
window.mathjax_url = "static/components/MathJax/MathJax.js";
window.mathjax_url = "static/components/MathJax/MathJax.js?v={{BASTHON_CACHE_BUSTING_TIMESTAMP}}";
</script>
<link rel="stylesheet" href="static/components/bootstrap-tour/build/css/bootstrap-tour.min.css" type="text/css" />
<link rel="stylesheet" href="static/components/codemirror/lib/codemirror.css">
<link rel="stylesheet" href="static/components/bootstrap-tour/build/css/bootstrap-tour.min.css?v={{BASTHON_CACHE_BUSTING_TIMESTAMP}}" type="text/css" />
<link rel="stylesheet" href="static/components/codemirror/lib/codemirror.css?v={{BASTHON_CACHE_BUSTING_TIMESTAMP}}">
<link rel="stylesheet" href="static/style/style.min.css" type="text/css"/>
<link rel="stylesheet" href="static/style/style.min.css?v={{BASTHON_CACHE_BUSTING_TIMESTAMP}}" type="text/css"/>
<link rel="stylesheet" href="static/notebook/css/override.css" type="text/css" />
<link rel="stylesheet" href="static/notebook/css/override.css?v={{BASTHON_CACHE_BUSTING_TIMESTAMP}}" type="text/css" />
<link rel="stylesheet" href="" id='kernel-css' type="text/css" />
<link rel="stylesheet" href="custom/custom.css" type="text/css" />
<script src="static/components/es6-promise/promise.min.js" type="text/javascript" charset="utf-8"></script>
<script src="static/components/react/react.production.min.js" type="text/javascript"></script>
<script src="static/components/react/react-dom.production.min.js" type="text/javascript"></script>
<script src="static/components/create-react-class/index.js" type="text/javascript"></script>
<script src="static/components/requirejs/require.js" type="text/javascript" charset="utf-8"></script>
<link rel="stylesheet" href="custom/custom.css?v={{BASTHON_CACHE_BUSTING_TIMESTAMP}}" type="text/css" />
<script src="static/components/es6-promise/promise.min.js?v={{BASTHON_CACHE_BUSTING_TIMESTAMP}}" type="text/javascript" charset="utf-8"></script>
<script src="static/components/react/react.production.min.js?v={{BASTHON_CACHE_BUSTING_TIMESTAMP}}" type="text/javascript"></script>
<script src="static/components/react/react-dom.production.min.js?v={{BASTHON_CACHE_BUSTING_TIMESTAMP}}" type="text/javascript"></script>
<script src="static/components/create-react-class/index.js?v={{BASTHON_CACHE_BUSTING_TIMESTAMP}}" type="text/javascript"></script>
<script src="static/components/requirejs/require.js?v={{BASTHON_CACHE_BUSTING_TIMESTAMP}}" type="text/javascript" charset="utf-8"></script>
<script>
require.config({
......@@ -144,7 +144,7 @@ dir="ltr">
<div id="header" role="navigation" aria-label="Top Menu">
<div id="header-container" class="container">
<div id="ipython_notebook" class="nav navbar-brand">
<img src="static/base/images/logo.png" alt="Jupyter Notebook"/>
<img src="static/base/images/logo.png?v={{BASTHON_CACHE_BUSTING_TIMESTAMP}}" alt="Jupyter Notebook"/>
</a></div>
......@@ -547,9 +547,9 @@ dir="ltr">
sys_info = {"notebook_version": "6.0.3", "notebook_path": "/usr/lib/python3/dist-packages/notebook", "commit_source": "", "commit_hash": "", "sys_version": "3.7.3 (default, Apr 3 2019, 05:39:12) \n[GCC 8.3.0]", "sys_executable": "/usr/bin/python3", "sys_platform": "linux", "platform": "Linux-4.19.0-6-amd64-x86_64-with-debian-10.2", "os_name": "posix", "default_encoding": "UTF-8"};
</script>
<script src="static/components/text-encoding/lib/encoding.js" charset="utf-8"></script>
<script src="static/components/text-encoding/lib/encoding.js?v={{BASTHON_CACHE_BUSTING_TIMESTAMP}}" charset="utf-8"></script>
<script src="static/notebook/js/main.min.js" type="text/javascript" charset="utf-8"></script>
<script src="static/notebook/js/main.min.js?v={{BASTHON_CACHE_BUSTING_TIMESTAMP}}" type="text/javascript" charset="utf-8"></script>
......
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