Admin+Config: Add toggle that disables Cloudflare cache

It's now possible to disable the Cloudflare cache during development,
so the hacky workaround with the random number in the CSS/JS URLs is no
longer needed.

Development mode is automatically disabled by Cloudflare after 4 hours.
This commit is contained in:
Riyyi
2021-08-25 18:24:33 +02:00
parent 8e8d5714b4
commit 253a3fe2f6
7 changed files with 61 additions and 3 deletions
+1 -1
View File
@@ -22,7 +22,7 @@
<link href="https://cdn.jsdelivr.net/npm/prismjs@1.22.0/themes/prism-tomorrow.min.css" rel="stylesheet" integrity="sha384-rG0ypOerdVJPawfZS6juq8t8GVE9oCCPJbOXV/bF+e61zYW9Ib6u9WwSbTOK6CKA" crossorigin="anonymous">
<link href="https://cdn.jsdelivr.net/npm/prismjs@1.22.0/plugins/line-numbers/prism-line-numbers.min.css" rel="stylesheet" integrity="sha384-n3/UuPVL3caytud/opHXuyFoezGp2oAUB0foYaCAIs2QwGv/nV0kULHS2WAaJuxR" crossorigin="anonymous">
<link href="<?= Config::c('APP_URL'); ?>/css/style.css?v=<?= rand(); ?>" rel="stylesheet">
<link href="<?= Config::c('APP_URL'); ?>/css/style.css" rel="stylesheet">
<title><?= ($this->escape)($this->pageTitle); ?><?= $this->pageTitle != '' ? ' - ' : '' ?>Rick van Vonderen</title>
<link rel="icon" type="image/png" href="<?= Config::c('APP_URL'); ?>/img/favicon.png">
+3
View File
@@ -22,6 +22,9 @@
<br>
- <a href="<?= \App\Classes\Config::c('APP_URL'); ?>/admin/syntax-highlighting">Syntax Highlighting</a>
<hr>
<h5>Development mode&nbsp;&nbsp;<button id="development-mode" class="py-0 btn btn-dark">Enable</button></h5>
<hr>
- <a href="<?= \App\Classes\Config::c('APP_URL'); ?>/logout">Log out</a>
</div>
+2 -2
View File
@@ -23,6 +23,6 @@
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.22.0/plugins/line-numbers/prism-line-numbers.min.js" integrity="sha384-xktrwc/DkME39VrlkNS1tFEeq/S0JFbc8J9Q8Bjx7Xy16Z3NnmUi+94RuffrOQZR" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.22.0/plugins/highlight-keywords/prism-highlight-keywords.min.js" integrity="sha384-Rk2xv6YOAfQH8z3ZAK37pgnQihXfgkER8B5EYhoFc+mMNPzf+t7g2J9U74FAvy2T" crossorigin="anonymous"></script>
<script src="<?= Config::c('APP_URL'); ?>/js/app.js?v=<?= rand(); ?>"></script>
<script src="<?= Config::c('APP_URL'); ?>/js/app.js"></script>
<?php } ?>
<script src="<?= Config::c('APP_URL'); ?>/js/site.js?v=<?= rand(); ?>"></script>
<script src="<?= Config::c('APP_URL'); ?>/js/site.js"></script>