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
+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>