From a83dc8bba93990d0ca425abbdb6d5c5014f80bb6 Mon Sep 17 00:00:00 2001 From: Aevann Date: Fri, 17 Mar 2023 11:44:05 +0200 Subject: [PATCH] make CF cache emojis without an extra page rule --- files/assets/js/emoji_modal.js | 2 +- files/routes/static.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/files/assets/js/emoji_modal.js b/files/assets/js/emoji_modal.js index cf94c61ec..040071100 100644 --- a/files/assets/js/emoji_modal.js +++ b/files/assets/js/emoji_modal.js @@ -139,7 +139,7 @@ const emojisSearchDictionary = { // get public emojis list const emojiRequest = new XMLHttpRequest(); -emojiRequest.open("GET", '/emojis'); +emojiRequest.open("GET", '/emojis.csv?v=1'); emojiRequest.setRequestHeader('xhr', 'xhr'); emojiRequest.onload = async (e) => { let emojis = JSON.parse(emojiRequest.response); diff --git a/files/routes/static.py b/files/routes/static.py index 2eeb2774d..d6be0c247 100644 --- a/files/routes/static.py +++ b/files/routes/static.py @@ -61,7 +61,7 @@ def marseys(v:User): break return render_template("marseys.html", v=v, marseys=marseys) -@app.get("/emojis") +@app.get("/emojis.csv") @limiter.limit(DEFAULT_RATELIMIT) def emoji_list(): return get_emojis(g.db)