QR code is not working correctly #3819
-
Hello everyone, We are using YOURLS to create a short URL to use with a static QR code. The problem we are facing; After deleting all the website data on the iPhone, the correct URL is still not shown. Hope anyone got a solution for this. Version: 1.9.2 Thank you, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 9 replies
-
This is unrelated to the QR code. YOURLS by default uses a "permanent" redirect that browsers cache very aggressively. #3545 describes something similar, as do #1778 and #1832 and many other threads over the years. The solution is a plugin to send temporary redirects instead. |
Beta Was this translation helpful? Give feedback.
My own testing indicates that browsers will still cache 302s for some period of time without being explicitly told not to. HTTP headers can influence how long it takes; by default, on my YOURLS instance, I see a
max-age
of 600 seconds.YOURLS includes a function that it uses to send headers disable caching on some pages, mostly in the admin area. I created a simple plugin that calls it also for shorturl redirections: https://github.com/dgw/yourls-shorturl-no-cache
In further testing, I no longer see "(from disk cache)" in Dev Tools' Network pane when accessing recently-used shorturls on my instance, and editing the long URL now takes effect immediately. I've proposed adding the plugin to …