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. We absolutely love your blog and find nearly all of your post’s to be exactly I’m
    looking for. Does one offer guest writers to write content for yourself?
    I wouldn’t mind composing a post or elaborating on a number of the subjects you
    write related to here. Again, awesome site!

  2. продвижение сайтов под ключ заказать сео продвижение сайта москва

  3. Антикор – компания, которая широкий спектр услуг по антикоррозийной обработке транспортных средств предоставляет. Сотрудничаем с юридическими и физическими лицами. Используем только качественные материалы. Доверьтесь настоящим профессионалам! https://antikor-kirov.ru – здесь представлены наши работы, ознакомиться с ними можете в любое удобное время. У нас много клиентов довольных. Гарантируем персональный подход. Позвоните нам, и мы вас по необходимым вопросам дадим консультацию. Защитите ваш автомобиль от ржавчины и коррозии!

  4. Selamat datang di jp500 Official, tempat terbaik untuk merasakan sensasi permainan game slot
    yang seru dan menguntungkan. Dengan berbagai pilihan game slot yang menarik, jp500 Official menawarkan hiburan tanpa batas dengan tema yang beragam, mulai dari klasik hingga video slot dengan fitur bonus yang pastinya membuat ketagihan.
    Bergabung sekarang di jp500 Official dan nikmati pengalaman bermain yang menyenangkan. Dapatkan kesempatan besar untuk menang di berbagai game slot dengan RTP kompetitif, memberi Anda
    peluang lebih besar untuk mendapatkan jackpot. Semua game
    di jp500 dijamin aman dengan proteksi data yang canggih,
    memastikan privasi dan transaksi Anda terjaga
    dengan aman.
    Jangan lewatkan berbagai pilihan permainan slot terbaik di jp500 Official.
    Pilih game favorit Anda dan menangkan jackpot besar.

    https://heylink.me/jp500.official