MooTools Depender, Safari, etags and 412 Precondition Failed

/**
* This replaces the default MooTools more Depender.request function to use
* HTTP "get" rather than "post".
*
* When sending requests for files via the depender, I was finding that Safari
* wasn't getting and re-evaluating them the second time I visited the page.
* This was because an etag was sent with each script.
*
* Safari responds to etags properly and adds "If-None-Match" and
* "If-Modified-Since" headers to another request for the same file. This makes
* Apache respond with a 412 status (Precondition Failed) as it should do for
* "post" requests (according to RFC 2616).
*
* Unfortunately Safari doesn't then deal with the 412 as it does with a 304
* (Not Modified). It doesn't grab what it has in the cache and put it in the
* response, it gives you nothing.
*
* For "get" requests, Apache has to respond with a 304, or 200 or whatever, but
* not 412. So we change the request method so we don't have to deal with 412.
*/
Depender.request = function(url, callback){
    new Request.JSON({
        url: url,
        secure: false,
        onSuccess: callback,
        method:'get'
    }).send();
};

24,935 thoughts on “MooTools Depender, Safari, etags and 412 Precondition Failed

  1. Hello! I could have sworn I’ve been to this website before but after going through many of the posts I realized it’s new
    to me. Regardless, I’m definitely delighted I came across it
    and I’ll be bookmarking it and checking back often!

  2. На сайте https://t.me/swiftpay_ru вы сможете ознакомиться с содержательной, актуальной информацией, которая касается компании SwiftPay. Здесь же вы сможете осуществить все необходимые финансовые операции. С этой системой вы сможете осуществить финансовые перестановки как за рубеж, так и по России. Здесь же выполняются и различные SWIFT платежи, возможно осуществить продажу либо покупку USDT. Дополнительно получится оплатить различные услуги. От использования сервиса вас ожидают только достоинства. К тому же, вся информация обрабатывается максимально оперативно.

  3. Write more, thats all I have to say. Literally, it
    seems as though you relied on the video to make
    your point. You clearly know what youre talking about, why throw away your intelligence on just posting videos to your
    site when you could be giving us something informative to read?

    My site; Roulette

  4. I’m really loving the theme/design of your blog. Do you ever run into
    any browser compatibility problems? A small number of my blog visitors have complained about my site not operating correctly in Explorer but
    looks great in Opera. Do you have any advice to help fix this issue?

  5. whoah this weblog is excellent i really like reading your articles.
    Keep up the good work! You recognize, a lot of persons are looking around for this info, you
    could aid them greatly.

  6. Свежие актуальные новости мира спорта со всего мира. Результаты матчей интервью аналитика расписание игр и обзоры соревнований. Будьте в курсе главных событий каждый день

  7. For newest information you have to go to see world-wide-web and on internet I found this web site as a most excellent website for most recent updates. kuwait international bank

  8. Свежие новости мма: бои результаты анонсы турниров интервью и трансферы бойцов. UFC Bellator ACA и другие промоушены. Следите за карьерой топовых бойцов и громкими поединками в мире смешанных единоборств.

  9. Fresh and relevant latest football news: matches results transfers interviews and reviews. Follow the events of the Champions League RPL EPL and other tournaments. All the most important from the world of football – on one page

  10. Thank you for the auspicious writeup. It in truth was once a entertainment
    account it. Glance complicated to far delivered agreeable from you!

    By the way, how can we communicate?

  11. Fresh and relevant sports news football: matches results transfers interviews and reviews. Follow the events of the Champions League RPL EPL and other tournaments. All the most important from the world of football – on one page