drogonframework / drogonframework/drogon

Unable to refresh custom 404 page

Open
#1,979 11 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
C++
Stars
14.3k
Forks
1.4k
Avg merge
1d 13h
Merged PRs (30d)
14

Description

**Describe the bug**
In a real-time system, the 404 page may get updated, and since the custom 404 page is cached in Drogon, we have to call `drogon::app().setCustom404Page` to refresh its content, however, this doesn't happen.
For SPAs this is a significant issue, as the only way to refresh its content is through restarting the server.

**To Reproduce**
Steps to reproduce the behavior:
1. Create a 404 page
2. Call `drogon::app().setCustom404Page` and point it to the 404 file
3. Open the browser and go somewhere random, note the current page
4. In the backend edit the 404 page contents and save the file
5. Refresh the browser, you'll still see the old 404 page
6. Now create an API endpoint that calls `drogon::app().setCustom404Page` and returns 200 OK
7. Call the API
8. Still shows the old 404 page

**Expected behavior**
Either the 404 shouldn't be cached, or we should be allowed to refresh it.

**Desktop (please complete the following information):**
- OS: Ubuntu
- Browser: Google Chrome

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.