Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

So many great features in this release. Love the .args and subprocess support. I have been toying with redbean on and off, and I have been wanting to see if I could kludge together a poor man's long running job (scheduled) runner (something like Celery).

Also, why is redbean.dev not ported to 2.0?



Try hitting ctrl+shift+r in your browser. Sometimes browsers don't respect the cache headers which say 1 hour max and I haven't figured out why. This new release includes functions like setitimer() to help the primitives be there for anyone wanting to use Lua to build something like Celery.


HTTP has some strange rules about using stale caches so usually you want to add must-revalidate to your cache-control header. That ensures that the browser must revalidate once the cache goes stale.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Ca...

Personally I've opted for "stale only" caching, so everything is served with Cache-Control: max-age=0,must-revalidate and a Last-Modified header and the browser will always make corresponding If-Modified-Since requests. This means significantly more requests per page, even if the responses are mostly 304 Not Modified, but getting to avoid all forms of cache busting makes developing a lot nicer.


> This means significantly more requests per page, even if the responses are mostly 304 Not Modified,

How expensive is that? I would naively have expected that comparing timestamps and sending a 304 was cheap to execute.


It's definitely cheap to execute, the problem lies in the network overhead. With sub-resources (css, js, images) you can go from 1 request per page to 10 or 100 which is still negligible for fast connections (10 mbps+, http2) and servers with low request overhead - but the worst case scenario is high latency http1 connections where each request really matters.

However if you are serving clients with highly restricted bandwidth you're probably going to want extremely cacheable resources (public, immutable) and perhaps even a completely different site architecture.


Firefox uses Ctrl-R instead.


Maybe that depends on the OS? Firefox on Linux does a normal refresh for me when doing CTRL+R but a hard refresh (without any cache) when I do CTRL+SHIFT+R.


This is standard at least across Chrome and Firefox on Linux and MacOS— (ctrl|cmd)+R does a normal page refresh, (ctrl|cmd)+shift+R does a "hard refresh" where it reloads every resource on the page without caching.

Also, in Chrome, if and only if you have the dev tools open, right clicking the reload button will give you a menu with the options "Normal Reload", "Hard Reload", and "Empty Cache and Hard Reload". The third option will ensure that requests initiated by JS or that otherwise weren't part of the page load also won't be served from cache.


Ok MacOs (Chrome), I'll usually open View and hold down shift. 'Reload This Page' changes to 'Force Reload This Page' and I like the visual feedback that it's actually doing what I intend.


How long has this been a thing, and (more worryingly) how have I never heard about it until now? Is this common knowledge?


Modifiers have been a thing since at least Netscape 4[1][2]

I'm pretty sure I remember using it earlier than that but can't be 100%.

[1] https://bugzilla.mozilla.org/show_bug.cgi?id=46845#c7

[2] http://www.bu.edu/uis_web3270/en/doc/troubleshoot/pd_ck_down...


Since before 2009 or something.

But it hasn't always been easy to find documentation about it, thanks to a combination I think of "simplifying" everything and Google not delivering correct results since somewhere around 2010.

Thankfully now there is Kagi that actually makes a bug report if you provide them with an example that doesn't work.


I think I've been using that shortcut for as long as I can remember. In web development circles it's certainly common knowledge, as you always end up in a situation or two where you need to reload without cache, but you don't want to clear the entire browser's cache.


Common knowledge for a very long time. Also F5/shift-F5.


Nevermind, you're right. I've always thought it was without the shift on Firefox.

Sorry for the misinformation




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: