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();
};

8,038 thoughts on “MooTools Depender, Safari, etags and 412 Precondition Failed

  1. Современный сайт renault-russia.ru на котором легко найти нужную и полезную информацию товары или услуги. Простая навигация понятный интерфейс и актуальное содержание подойдут как для новых пользователей так и для постоянной аудитории. Работает быстро доступен круглосуточно.

  2. провайдеры интернета по адресу москва msk-domashnij-internet003.ru подключение интернета по адресу

  3. Wow that was unusual. I just wrote an incredibly long comment but after I clicked submit my comment didnt show up. Grrrr… well Im not writing all that over again. Anyways just wanted to say wonderful blog Mobile plans Kuwait

  4. Good day Do you know if they make any plugins to protect against hackers? Im kinda paranoid about losing everything Ive worked hard on. Any tips? Zain quick recharge

  5. Hi mates its impressive article regarding tutoringand fully explained keep it up all the time. Lifesaver plans

  6. Car service struts and shocks services We provide car repair services: from quick diagnostics to major restoration. Quality guarantee experienced specialists clear deadlines and original spare parts. We work with private and corporate clients.

  7. Hello this is kinda of off topic but I was wondering if blogs use WYSIWYG editors or if you have to manually code with HTML. Im starting a blog soon but have no coding experience so I wanted to get advice from someone with experience. Any help would be greatly appreciated Hafilat card recharge

  8. домашний интернет тарифы нижний новгород nizhnij-novgorod-domashnij-internet001.ru домашний интернет тарифы нижний новгород

  9. Car service transmission fluid change cost services We provide car repair services: from quick diagnostics to major restoration. Quality guarantee experienced specialists clear deadlines and original spare parts. We work with private and corporate clients.

  10. whoah this weblog is great i really like studying your posts. Stay up the good work You already know many persons are hunting round for this information you can help them greatly. bus card balance check

  11. Hello this weekend is fastidious for me since this occasion i am reading this fantastic educational post here at my home. HasNightSea recharge

  12. האומץ שלך לא ידע גבולות. חיבקת אותי ואת החברה שלי נישקת את שניהם. נפרדת. הסתכלתי ולא יכולתי לרדת השתן שלי עמד כמו ערימה כמו שרציתי browse article

  13. интернет провайдеры нижний новгород по адресу nizhnij-novgorod-domashnij-internet002.ru интернет провайдер нижний новгород

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>