Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Static content cache problem
#1
So i´ve run into a little problem that caused me not to see a map for some hours after its release.
Fair to say, it kinda was my own fault. Still, the map delivery system (xxxx.js) should be better at this point.
The reason this happened is pretty simple:
If you try to access a map before its actually released (like, to see if it exists a few seconds before the timer says so), the js containing the map exists, with the content of "null". Since that is static content, cloudflare caches that with a pretty high timeout for the cache. Which leads to the map being null when it actually exists, until they check the cache again.
So i suggest before a map exists, the js should not be accessible or the request should cause a redirect. Not only to fix this (minor, but pretty annoying) bug, but because its probably the better way to do so.
Also, why does the server take that long for a map change (of a single map)?
It took like 2min just to respond at that time...
Furthermore, why do maps exist as map/xxxx.js and a/map/xxxx.js?
SNAAAAAAP, do stuff! I broke it again...
Reply
#2
Nice 'catch' < pun.
- The .js is to just ask cloudflare to cache it for me.
Easy fix. Thanks ^^.

Quote:Also, why does the server take that long for a map change (of a single map)?
I'm not sure what you mean. - The 4 main maps are created and inserted into the database at the same time. - - So the time it took to fix must have been the cache issue you described.
- Snap
Reply
#3
that time issue was when the UC got updated.
it took several minutes for the main site to load anything, including the other maps...
which got me to the question "why does it take that long?" ^^
i´m pretty sure that wasn't just the cached js, as the response time for that was as usual, it just was empty...
(interestingly, i looked at the cloudflare response header, it said cache time is 14400, which would be 4 hours. the map worked for me again 2 hours after release, so they probably checked for changes even before cache refresh time)
SNAAAAAAP, do stuff! I broke it again...
Reply
#4
The cache time from the response headers is how long your client will cache it, not how long Cloudflare caches it.

Cloudflare caches items for 7 days for free accounts (like ours) - I'm not really sure why it started working again, unless Snap purged the cache (or unless Cloudflare's FAQ is wrong).
Reply
#5
but i deleted all my caches as soon as i noticed it doesn't work...
refresh (+ctrl), delete history, even tried other browser...
SNAAAAAAP, do stuff! I broke it again...
Reply
#6
Well, not sure what happened there.. But this should solve it anyways.
non-existent maps will now return a 404 ^^.
- Snap
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)