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. I’m impressed, I must say. Seldom do I come across a blog
    that’s equally educative and engaging, and without a doubt,
    you have hit the nail on the head. The problem is something too few people are speaking intelligently about.
    I’m very happy that I came across this during my search for something relating to
    this.

  2. На сайте https://alumvolkov.ru/ оставьте заявку для того, чтобы заказать алюминиевое остекление коттеджей, а также домов. Вы получите самую привлекательную стоимость на рынке. Это доступно за счет особой бизнес-модели, которая экономит ваши деньги. Прямо сейчас вы сможете воспользоваться рекомендациями, а также заказать расчет цены. Все конструкции отличаются высоким качеством, надежностью и практичностью, потому наделены долгим сроком эксплуатации, прослужат несколько десятков лет, радуя привлекательным дизайном.

  3. It’s in point of fact a great and useful piece of info. I’m satisfied that you simply shared this helpful information with us.
    Please stay us informed like this. Thank you for sharing.

  4. Customer service is clearly a priority for Tampa Bay Pressure Washing. After the job was done, they followed up to ensure I was satisfied with the work, which demonstrated their commitment to client satisfaction. gutter cleaning tampa

  5. “Just got back from an event where they had multiple waterslides—I’m convinced every party needs one, especially here in hot Florida!” # # anyKeword #” tampa bounce

  6. Houston possesses a few of the best beautiful diamond engagement rings I have actually observed. If you’re in the place as well as searching for that unique item, you need to undoubtedly see nearby jewelry experts engagement rings houston

  7. Link exchange is nothing else except it is simply placing the other person’s blog link on your page at suitable place and other
    person will also do same for you.