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. Hi, I do believe this is a great website. I stumbledupon it ;) I’m going to come
    back yet again since I book-marked it. Money and freedom is the
    greatest way to change, may you be rich and continue to
    help other people.

  2. Hey I know this is off topic but I was wondering if you knew of any widgets I could add to my blog that automatically tweet my
    newest twitter updates. I’ve been looking for a plug-in like this for
    quite some time and was hoping maybe you would have some experience with
    something like this. Please let me know if you run into
    anything. I truly enjoy reading your blog and I look forward to your new updates.

  3. Wow, fantastic blog format! How lengthy have you been running a blog for?
    you make running a blog look easy. The entire look of your website is great, let alone the content material!

  4. Hi there this is kinda of off topic but I was wanting to know if blogs use WYSIWYG
    editors or if you have to manually code with HTML.
    I’m starting a blog soon but have no coding know-how so I wanted to get advice from someone with experience.
    Any help would be enormously appreciated!

  5. Start your future with a Bachelors in Computer Science at Satbayev University. Explore admission deadlines required documents and study options. Perfect for international students pursuing software development algorithms data structures https://satbayev.university/

  6. I just could not go away your site prior to suggesting that I extremely enjoyed the standard information a person supply in your guests?
    Is gonna be again incessantly to investigate cross-check
    new posts

  7. Woah! I’m really enjoying the template/theme of this blog. It’s simple, yet effective.
    A lot of times it’s tough to get that “perfect balance” between usability and appearance.
    I must say you’ve done a awesome job with this. Additionally, the blog loads extremely
    fast for me on Chrome. Exceptional Blog!

  8. На сайте https://iz-nerzhaveyki.ru/ ознакомьтесь с большим выбором продукции, которая выполнена из нержавеющей стали. В компании вы сможете заказать следующую продукцию: РВД, рукава высокого давления, а также гибкую подводку, обратные клапаны, фильтры, муфты, фланцы и многое другое. Все товары разработаны в соответствии с ГОСТом, по нормативам и с учетом высоких требований. Напротив каждого товара указаны технические характеристики, размеры и другая важная информация, которая является ключевой при покупке.

  9. Helpful info. Lucky me I found your web site unintentionally, and I am surprised why this coincidence didn’t
    took place earlier! I bookmarked it.

  10. натяжные потолки минск установка натяжных потолков цена за метр