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. It’s a shame you don’t have a donate button! I’d most certainly donate to this brilliant blog!

    I guess for now i’ll settle for book-marking and adding your RSS feed to my Google account.
    I look forward to fresh updates and will share this blog with my Facebook group.
    Talk soon!

  2. I know this if off topic but I’m looking into starting my own blog
    and was wondering what all is required to get set up? I’m assuming having a
    blog like yours would cost a pretty penny? I’m not very web savvy so I’m not 100% positive.
    Any recommendations or advice would be greatly appreciated.
    Many thanks

  3. Whoa! This blog looks exactly like my old one! It’s on a entirely different subject but it has
    pretty much the same page layout and design. Wonderful choice
    of colors!

  4. I think that is among the so much vital info for me.
    And i’m satisfied reading your article. But should statement on few general issues, The web site taste is perfect, the articles is in point of fact excellent : D.

    Just right task, cheers

  5. Hi there! Do you know if they make any plugins to assist with Search Engine Optimization? I’m trying to get my blog
    to rank for some targeted keywords but I’m not seeing very
    good results. If you know of any please share. Many
    thanks!

  6. На diabloshop.ru вы можете купить https://diabloshop.ru/product-category/diablo-4/ золото Diablo 4 руны Diablo 2 Resurrected а также уникальные предметы и легендарное снаряжение для всех платформ — PC Xbox PlayStation и Nintendo Switch. Мы предлагаем быстрый буст персонажа услуги прокачки сбор лучших билдов и готовые комплекты снаряжения.

  7. Heya i’m for the first time here. I came across this board and I find
    It truly useful & it helped me out much. I hope to give something back and aid others like you aided me.

  8. I’m really loving the theme/design of your blog. Do you ever run into any
    browser compatibility issues? A handful of my blog audience have complained about my site not operating correctly in Explorer but looks great in Opera.
    Do you have any ideas to help fix this problem?

  9. Hey there I am so thrilled I found your blog page, I really found you
    by mistake, while I was searching on Askjeeve for something else,
    Anyhow I am here now and would just like to say thanks a lot
    for a fantastic post and a all round interesting blog (I also love the theme/design), I
    don’t have time to read it all at the minute but I have
    book-marked it and also added in your RSS feeds, so when I
    have time I will be basck to read a great deal more, Please do keep up the great job.

  10. Hi there! This article couldn’t be written much better! Looking through this post reminds me of my previous roommate!

    He always kept preaching about this. I’ll forward this information to
    him. Fairly certain he’s going to have a great read. Many thanks for sharing!

  11. Играешь в Fallout 76? Хочешь купить шмот Fallout 76? Широкий ассортимент предметов включая силовую броню легендарное оружие хлам схемы и многое другое для Fallout 76 на PC Xbox и PlayStation. Мы предлагаем услуги буста прокачки персонажа и готовые комплекты снаряжения.

  12. На diabloshop.ru вы можете купить https://diabloshop.ru/product-category/diablo-3-reaper-of-souls/ золото Diablo 4 руны Diablo 2 Resurrected а также уникальные предметы и легендарное снаряжение для всех платформ — PC Xbox PlayStation и Nintendo Switch. Мы предлагаем быстрый буст персонажа услуги прокачки сбор лучших билдов и готовые комплекты снаряжения.

  13. There’s certainly a great deal to know about this subject.
    I like all the points you have made.

  14. You really make it seem so easy along with your presentation however I in finding this matter to be actually something that
    I feel I would by no means understand. It kind
    of feels too complex and very large for me. I am having a look forward in your next post, I will
    attempt to get the cling of it!

  15. Heya i’m for the first time here. I came across this board and I find It
    truly useful & it helped me out a lot. I hope to give something back and
    aid others like you helped me.