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 really like your writing so so much! proportion we keep up a correspondence extra approximately your article on AOL?
    I need an expert in this area to unravel my problem.
    Maybe that is you! Looking ahead to look you.

  2. When someone writes an piece of writing he/she retains the thought
    of a user in his/her brain that how a user can know it.
    Thus that’s why this paragraph is amazing. Thanks!

  3. quick loan
    It’s in reality a nice and useful piece of info.

    I’m glad that you shared this helpful information with us.
    Please keep us informed like this. Thanks for sharing.

  4. Новостной портал https://sensus.org.ua главные события дня в России и мире. Политика экономика общество культура спорт и технологии. Только проверенные факты оперативные сводки мнения экспертов и честная подача.

  5. Thankfulness to my father who informed me concerning this
    blog, this web site is truly awesome.

  6. медицинский портал https://pobedilivmeste.org.ua с удобной навигацией и актуальной информацией. Болезни симптомы приёмы врачей анализы исследования препараты и рекомендации.

  7. Good day! I know this is kind of off topic but I was wondering which blog platform
    are you using for this website? I’m getting sick and tired of WordPress because I’ve had problems with
    hackers and I’m looking at alternatives for another platform.
    I would be great if you could point me in the direction of a good platform.

  8. My coder is trying to convince me to move to .net from PHP.
    I have always disliked the idea because of the costs.
    But he’s tryiong none the less. I’ve been using Movable-type on various websites
    for about a year and am anxious about switching to another platform.
    I have heard good things about blogengine.net. Is there a way I can transfer all my wordpress posts into it?
    Any kind of help would be greatly appreciated!