Como parar o cache com jQuery e javascript

Há muitas razões para as pessoas querem desativar ou parar caching por broswer. Especialmente quando se trata de conteúdo dinâmico que exigiu a versão mais recente a ser exibido no navegador. No entanto, devido a razões de segurança, não existem métodos perfeitos em javascript que pode com deficiência cache para todos os navegadores. Neste tutorial, vou demonstrar uma maneira poucos JavaScript e jQuery usado para interromper ou desativar o cache de navegadores.
jQuery

Na versão mais recente jQuery v1.2 acima, jQuery tem proporcionado um método para parar de cache de navegador com sua classe ajax. Você pode visitar o site jQuery para ver a lista de atualização em v1.2 e você vai notar que eles já incluiu uma função para desativar o cache! Você pode escolher para controlar o modo como cada indivíduo conteúdo dinâmico em cache, definindo as propriedades de verdadeiro / falso ou você pode apenas definir um padrão para todos os deficientes o cache do navegador.

A fim de determinar as propriedades de cada ajax cache de chamadas,

 $. Ajax ({
 url: 'teste.html',
 de cache: false,
 sucesso: function (html) {
 $ ('# resultados') append (html).;
}
});

que está sendo refletido no exemplo jQuery. E, a fim de desativar todo o cache pelo navegador, podemos fazer o seguinte,

$ ajaxSetup ({cache: false}});.

Isto terá de ser colocada no topo do script para que ele funcione.
Javascript

A razão pela qual os navegadores são capazes de armazenar em cache um documento particular é devido ao url que está sendo passado para o navegador são idênticos. A fim de tornar único para cada passes, podemos colocar em um número aleatório por trás da url como mostrado abaixo,

 var img.src = 'www.hungred.com' + + Math.random () * Math.random () '?';
 return $ (img). Carga (function ()
 {
 alert ('concluído');
});

Este método irá garantir que todos os documentos para ser exclusivo para cada dinâmica passa você joga para o navegador que eu achar que é mais confiável e útil como este método tem sido há muito, por vezes, e quase todo o navegador irá apoiar tal maneira de recuperar o conteúdo dinâmico.
HTML (16/04/2009)

Você também pode desativar ou parar cache utilizando a seguinte meta tag,




Isso vai evitar que a página inteira ser armazenada em cache pelo navegador também.

tradução de: http://hungred.com/how-to/tutorial-stop-caching-jquery-javascript/

245 thoughts on “Como parar o cache com jQuery e javascript

  1. The 8-arm pine perc with three slits in each arm gives substantial bubbling as
    you are able to see though the glass.

    Stop by my blog – head shops denver open late (Elvia)

  2. A huge selection of consumers look around every single day, and also our pipes and bongs’ majority are
    being sent mostly towards the US.

    Feel free to visit my web page glass bong for sale in malaysia – Chastity,

  3. Wow, amazing blog layout! How long have you been blogging for?
    you made blogging look easy. The overall look of your site is
    great, let alone the content!

    Here is my website … biofuels

  4. magnificent submit, very informative. I wonder why the other
    experts of this sector do not realize this.
    You must proceed your writing. I’m confident, you’ve a huge readers’ base already!

    my web-site – plumbing

  5. I enjoy what you guys tend to be up too. Such clever work and coverage!
    Keep up the terrific works guys I’ve included you guys to my own blogroll.

    Feel free to visit my blog post; Air conitioner
    repair service [Aurelio]

  6. I loved as much as you’ll receive carried out right here. The sketch is attractive, your authored subject matter stylish.
    nonetheless, you command get bought an edginess over that you wish be delivering the following.

    unwell unquestionably come more formerly again as exactly the same nearly a lot often inside case you shield this hike.

    Here is my webpage; online payday loans

  7. Attractive section of content. I just stumbled upon your weblog and in accession capital to assert that I acquire
    in fact enjoyed account your blog posts. Anyway I’ll be subscribing to your
    augment and even I achievement you access consistently
    fast.

  8. Hello, every time i used to check wdbsite posts here in the early hours in the break of day, because
    i enjoy to gain knowledge of more and more.

  9. Thank you for every other fantastic article. Where else could anyone get that
    kind of info in such an ideal manner of writing? I
    have a presentation subsequent week, and I am at the look for such info.

  10. I truly wanted to write a brief note so as to say thanks to you for the stunning secrets you are sharing here. My extensive internet investigation has at the end of the day been paid with pleasant suggestions to share with my friends and family. I would repeat that we readers actually are unequivocally blessed to live in a very good network with many brilliant individuals with very helpful techniques. I feel somewhat grateful to have encountered your entire webpages and look forward to some more pleasurable minutes reading here. Thank you once more for everything.

  11. After I originally left a comment I seem to have clicked the -Notify me when new comments are added- checkbox and from now on each time a comment is added I receive 4
    emails with the same comment. Perhaps there is a means you
    are able to remove me from that service? Appreciate it!

  12. Hiya! Quick question that’s completely off topic.
    Do you know how to make your site mobile friendly? My weblog looks weird
    when viewing from my iphone. I’m trying to find a theme
    or plugin that might be able to correct this problem.
    If you have any recommendations, please share. Thank you!

  13. HS8K2g You can definitely see your skills within the work you write. The sector hopes for more passionate writers such as you who are not afraid to say how they believe. Always go after your heart.

  14. Have you ever considered publishing an e-book or guest authoring
    on other sites? I have a blog based upon on the same ideas you discuss
    and would love to have you share some stories/information. I know my audience would
    appreciate your work. If you’re even remotely interested, feel free to shoot me
    an email.

  15. This design is incredible! You obviously know how to keep a reader entertained.
    Between your wit and your videos, I was almost moved to
    start my own blog (well, almost…HaHa!) Wonderful job.

    I really loved what you had to say, and more than that, how you presented it.
    Too cool!

  16. Pingback: Google
  17. Fantastic goods from you, man. I’ve take into account your
    stuff prior to and you are simply extremely fantastic.
    I really like what you have acquired here, really like what you’re saying and the
    best way by which you say it. You’re making it entertaining and you still care for to keep it wise.

    I can’t wait to read far more from you. This is really a tremendous website.

  18. Hey there! Quick question that’s entirely off topic.

    Do you know how to make your site mobile friendly?
    My blog looks weird when browsing from my apple iphone.
    I’m trying to find a theme or plugin that might be able to correct this
    issue. If you have any suggestions, please share.
    With thanks!

  19. Pingback: play online games
  20. I don’t know if it’s just me or if perhaps everybody else encountering issues
    with your site. It looks like some of the text on your content
    are running off the screen. Can somebody else please provide feedback and let
    me know if this is happening to them as well? This could be a problem with my browser because I’ve had this happen previously.
    Appreciate it

  21. Pingback: Indiatimes.com
  22. Pingback: cursos gratuitos
  23. Have you ever considered creating an e-book or guest authoring on other sites?

    I have a blog based on the same ideas you discuss and would really like to have you share some stories/information. I know my audience would value
    your work. If you’re even remotely interested, feel free to shoot me an e mail.

  24. Pingback: dick toys
  25. Amoxicillin Strain Bacteria Product 176 [url=http://avdrug.com]cialis pas cher levitra[/url] Comparaison Cialis Viagra Levitra Real Levaquin Bebe Avec Clomid

  26. Pingback: strap-on dildo
  27. Pingback: sexe webcam
  28. Pingback: shemale sexdate
  29. Pingback: rencontres sexe
  30. Pingback: sexe webcam
  31. Pingback: g spot sex toy
  32. Pingback: the thrusting vibe
  33. Pingback: cyberskin dong
  34. Pingback: male masturbator
  35. This design is incredible! You definitely know how to
    keep a reader amused. Between your wit and
    your videos, I was almost moved to start my own blog (well, almost…HaHa!) Fantastic job.
    I really enjoyed what you had to say, and more than that, how
    you presented it. Too cool!

  36. [url=http://sildenafil01.us.com/]buy sildenafil online[/url] [url=http://buyviagra247.us.com/]cheap viagra[/url] [url=http://buytadalafil247.us.com/]tadalafil tablets 20 mg[/url] [url=http://buyxenical24.us.org/]Buy Xenical[/url]

  37. Pingback: butt plug
  38. [url=https://phenergandm.com/]phenergan[/url] [url=https://atarax25.com/]atarax 25mg[/url] [url=https://amoxicillin250.com/]amoxicillin no prescription[/url] [url=https://furosemide80.com/]furosemide[/url] [url=https://propranolol80.com/]propranolol order online[/url]

  39. It’s a shame you don’t have a donate button! I’d without a doubt donate to this brilliant blog!
    I suppose for now i’ll settle for bookmarking and adding your RSS feed to my Google account.
    I look forward to fresh updates and will
    share this website with my Facebook group. Talk soon!

  40. Pingback: mir snov
  41. [url=http://buykamagra24.com/]kamagra online[/url] [url=http://retin-a.us.com/]retin-a[/url] [url=http://buyventolin24.us.com/]ventolin inhaler without prescription[/url]

  42. Pingback: anal vibrator
  43. Pingback: huge dildo
  44. Pingback: best male strokers
  45. Have you ever considered about including a little bit more
    than just your articles? I mean, what you say is valuable and
    everything. However just imagine if you added some great photos
    or video clips to give your posts more, “pop”! Your content is excellent
    but with pics and videos, this blog could certainly be one of the
    most beneficial in its field. Great blog!

  46. [url=https://tetracyclinerx.com/]tetracycline[/url] [url=https://tadalafil100.com/]cheapest tadalafil[/url] [url=https://prednisone40.com/]prednisone 20 mg tablets[/url] [url=https://propecia5mg.com/]propecia 5mg for sale[/url] [url=https://dapoxetineusa.com/]dapoxetine[/url]

  47. If some one needs to be updated with newest technologies
    then he must be visit this site and be up to date all the time.

  48. Pingback: flexible dildo
  49. Pingback: suction cup dildo
  50. Hey there would you mind sharing which blog platform you’re
    working with? I’m planning to start my own blog soon but I’m
    having a difficult time deciding between BlogEngine/Wordpress/B2evolution and Drupal.

    The reason I ask is because your design seems different then most blogs and I’m looking for something completely unique.
    P.S My apologies for being off-topic but I had to ask!

  51. Ahaa, its fastidious dialogue about this article here at this
    blog, I have read all that, so now me also commenting here.

  52. Pingback: training buttplugs
  53. Pingback: Porn Land
  54. Hi there would you mind letting me know which web host you’re utilizing?

    I’ve loaded your blog in 3 different web browsers and I must say this blog loads a lot quicker then most.
    Can you suggest a good web hosting provider at a honest price?

    Many thanks, I appreciate it!

  55. Pingback: Cenforce-50
  56. I like the helpful info you supply to your articles. I’ll bookmark
    your weblog and take a look at once more right here regularly.
    I am quite certain I’ll learn plenty of new stuff right right here!

    Best of luck for the next!

  57. Fantastic blog! Do you have any recommendations for aspiring writers?
    I’m planning to start my own website soon but I’m a
    little lost on everything. Would you propose starting with a free platform like WordPress or go for a paid option? There
    are so many options out there that I’m completely overwhelmed ..

    Any recommendations? Thank you!

  58. Pingback: using dildo
  59. Woah! I’m really digging the template/theme of this website.
    It’s simple, yet effective. A lot of times it’s hard
    to get that “perfect balance” between usability and visual appearance.
    I must say that you’ve done a superb job with this.
    Additionally, the blog loads extremely fast for me on Safari.
    Outstanding Blog!

  60. you are really a just right webmaster. The website loading speed
    is incredible. It sort of feels that you are doing any unique trick.
    In addition, The contents are masterwork. you’ve performed a magnificent job in this matter!

  61. Pingback: root media 0000
  62. Thanks for your personal marvelous posting! I definitely enjoyed reading it, you
    might be a great author.I will be sure to bookmark your blog
    and definitely will come back down the road. I want to encourage yourself
    to continue your great job, have a nice afternoon!

  63. Pingback: ben wa balls
  64. Pingback: dildos
  65. [url=https://furosemide80.com/]furosemide[/url] [url=https://propranolol80.com/]ordering propanalol[/url] [url=https://phenergandm.com/]phenergan[/url] [url=https://lisinoprilmed.com/]lisinopril[/url] [url=https://amoxicillin250.com/]amoxicillin 250[/url] [url=https://atarax25.com/]atarax 25[/url]

  66. Pingback: big jelly dildo
  67. Pingback: rabbit vibrator
  68. Youthful girls, fresh-faced cuties and their hot nude bodies. You will love this selection of Young porn videos. Nasty young girls are so fresh and naive that they can be easily get talked to something nasty. Bestial young porn videos are just awesome.

  69. Pingback: best lube for sex
  70. Insane selection of hot Indonesian porn videos. The sexiest girls of Indonesia are ready to get naked and laid big time. Nude Indonesian sluts are becoming even hornier when they get fingered. Horny Indonesian porn videos are filled with horny hard cocks.

  71. Pingback: foreplay games
  72. Pingback: remote panties
  73. Absolutely filthy porn videos featuring completely and utterly deprived girls who enjoy weird nude sex. Hot nasty girls have a lot of unembodied sex fantasies and weird desires. Seductive nasty porn videos will make all of them come true right here.

  74. Pingback: pussy masturbator
  75. Male domination action with the hot nude slave girls who love their masters’ cocks on Maledom porn videos. Nude maledom is all about handsome muscular guy abusing and fucking a hot girl. Outrageous maledom porn videos are full of athletic dudes.

  76. Gorgeous girls taking their clothes off on camera. Hot babes baring their bodies on Undressing porn videos. Hot undressing is making every guy incredibly turned on and gives him a hard on. Seductive undressing porn videos are full of heated temptation.

  77. Pingback: best male stroker
  78. Pingback: double dong
  79. Boozed up and borderline shit-faced hot girls that love spreading their legs for nude hot guys on camera. Horny drunk girls are so funny and absolutely turned on. Lustful drunk porn videos are featuring hot bitches who are willing to do anything for a loaded cock.

Deixe uma resposta

O seu endereço de e-mail não será publicado.