SlideShare uma empresa Scribd logo
1 de 6
Baixar para ler offline
How To Avoid Cashing AJAX ?




                 Ramzi Sh. Alqrainy
                 qcs_2008@yahoo.com   1
How to clear the cache ?
You can't actually clear the cache as it's controlled by
the browser, but you can ask how to avoid caching
AJAX ??

Ooooops, What is this problem ?




                                 Ramzi Sh. Alqrainy
                                 qcs_2008@yahoo.com        2
What is the problem ?
   AJAX application tends to frequently ask the server
    for the same URL (a stock quote, application status
    and so forth). The AJAX application expect a
    response form the server while, in fact, after the
    first request the browser returns the cached page
    and the AJAX application does not work as
    expected.

So, What is the solution ?



                                Ramzi Sh. Alqrainy
                                qcs_2008@yahoo.com        3
What is the solution ?
 Imagine yourself you can not change
  HTML file. So, How to avoid caching
  AJAX?
 If you want bypass the cache you can add
  some random argument to the url:




What Happened ?
                         Ramzi Sh. Alqrainy
                         qcs_2008@yahoo.com   4
What happened ?
   Adding a pseudo-random parameter to the URL
    the AJAX application is requesting. Doing so will
    fool the browser to think this is a new page that
    has not yet been cached.

   The Date().getTime(); returns a new value every
    millisecond (or so), the browser thinks this is a new
    page that has not been cached and requests the
    URL form the server.



                                  Ramzi Sh. Alqrainy
                                  qcs_2008@yahoo.com        5
Thank You




      Ramzi Sh. Alqrainy
      qcs_2008@yahoo.com   6

Mais conteúdo relacionado

Mais procurados

W-JAX Performance Workshop - Web and AJAX
W-JAX Performance Workshop - Web and AJAXW-JAX Performance Workshop - Web and AJAX
W-JAX Performance Workshop - Web and AJAX
Alois Reitbauer
 
Explaining Ajax
Explaining AjaxExplaining Ajax
Explaining Ajax
adactio
 
Ajax Basics And Framework
Ajax Basics And FrameworkAjax Basics And Framework
Ajax Basics And Framework
shivas
 
Fronteers 20131205 the realtime web
Fronteers 20131205   the realtime webFronteers 20131205   the realtime web
Fronteers 20131205 the realtime web
Bert Wijnants
 

Mais procurados (20)

Lazy load Website Assets
Lazy load Website AssetsLazy load Website Assets
Lazy load Website Assets
 
Computers & Technology :: Extracting Data from an AJAX-enabled Web Site
Computers & Technology :: Extracting Data from an AJAX-enabled Web SiteComputers & Technology :: Extracting Data from an AJAX-enabled Web Site
Computers & Technology :: Extracting Data from an AJAX-enabled Web Site
 
W-JAX Performance Workshop - Web and AJAX
W-JAX Performance Workshop - Web and AJAXW-JAX Performance Workshop - Web and AJAX
W-JAX Performance Workshop - Web and AJAX
 
Ajax Presentation
Ajax PresentationAjax Presentation
Ajax Presentation
 
mukesh
mukeshmukesh
mukesh
 
Advantages and disadvantages of an ajax based client application
Advantages and disadvantages of an ajax based client applicationAdvantages and disadvantages of an ajax based client application
Advantages and disadvantages of an ajax based client application
 
Explaining Ajax
Explaining AjaxExplaining Ajax
Explaining Ajax
 
Ajax Basics And Framework
Ajax Basics And FrameworkAjax Basics And Framework
Ajax Basics And Framework
 
Introduction about-ajax-framework
Introduction about-ajax-frameworkIntroduction about-ajax-framework
Introduction about-ajax-framework
 
Caching By Nyros Developer
Caching By Nyros DeveloperCaching By Nyros Developer
Caching By Nyros Developer
 
Ajax.ppt
Ajax.pptAjax.ppt
Ajax.ppt
 
Ajax
AjaxAjax
Ajax
 
Ajax Ppt 1
Ajax Ppt 1Ajax Ppt 1
Ajax Ppt 1
 
Ajax Ppt
Ajax PptAjax Ppt
Ajax Ppt
 
Introduction to ajax
Introduction  to  ajaxIntroduction  to  ajax
Introduction to ajax
 
Fronteers 20131205 the realtime web
Fronteers 20131205   the realtime webFronteers 20131205   the realtime web
Fronteers 20131205 the realtime web
 
Web Application Performance for Business Success
Web Application Performance for Business SuccessWeb Application Performance for Business Success
Web Application Performance for Business Success
 
Ajax assignment help
Ajax assignment helpAjax assignment help
Ajax assignment help
 
Introduction to ajax
Introduction to ajaxIntroduction to ajax
Introduction to ajax
 
Nate Reist WCGR WP AJAX presentation
Nate Reist WCGR WP AJAX presentationNate Reist WCGR WP AJAX presentation
Nate Reist WCGR WP AJAX presentation
 

Semelhante a How to prevent the cache problem in AJAX

Eric Beland Ajax Load Testing Considerations
Eric Beland Ajax Load Testing ConsiderationsEric Beland Ajax Load Testing Considerations
Eric Beland Ajax Load Testing Considerations
Ajax Experience 2009
 
Ajax Load Testing Concerns By Eric Beland
Ajax Load Testing Concerns By Eric BelandAjax Load Testing Concerns By Eric Beland
Ajax Load Testing Concerns By Eric Beland
Testomatix
 
Using Ajax In Domino Web Applications
Using Ajax In Domino Web ApplicationsUsing Ajax In Domino Web Applications
Using Ajax In Domino Web Applications
dominion
 

Semelhante a How to prevent the cache problem in AJAX (20)

Ajax and PHP
Ajax and PHPAjax and PHP
Ajax and PHP
 
Ajax part i
Ajax part iAjax part i
Ajax part i
 
Ajax
AjaxAjax
Ajax
 
Ajax3
Ajax3Ajax3
Ajax3
 
Ajax Presentation
Ajax PresentationAjax Presentation
Ajax Presentation
 
Eric Beland Ajax Load Testing Considerations
Eric Beland Ajax Load Testing ConsiderationsEric Beland Ajax Load Testing Considerations
Eric Beland Ajax Load Testing Considerations
 
jQuery Ajax
jQuery AjaxjQuery Ajax
jQuery Ajax
 
Ajax
Ajax Ajax
Ajax
 
Ajax
AjaxAjax
Ajax
 
Ajax Load Testing Concerns By Eric Beland
Ajax Load Testing Concerns By Eric BelandAjax Load Testing Concerns By Eric Beland
Ajax Load Testing Concerns By Eric Beland
 
Ajax
AjaxAjax
Ajax
 
AJAX in ASP.NET
AJAX in ASP.NETAJAX in ASP.NET
AJAX in ASP.NET
 
Using Ajax In Domino Web Applications
Using Ajax In Domino Web ApplicationsUsing Ajax In Domino Web Applications
Using Ajax In Domino Web Applications
 
1 ppt-ajax with-j_query
1 ppt-ajax with-j_query1 ppt-ajax with-j_query
1 ppt-ajax with-j_query
 
Ajax Overview by Bally Chohan
Ajax Overview by Bally ChohanAjax Overview by Bally Chohan
Ajax Overview by Bally Chohan
 
How to Use AJAX in PHP and jQuery.pdf
How to Use AJAX in PHP and jQuery.pdfHow to Use AJAX in PHP and jQuery.pdf
How to Use AJAX in PHP and jQuery.pdf
 
Ajax
AjaxAjax
Ajax
 
Ajax and Jquery
Ajax and JqueryAjax and Jquery
Ajax and Jquery
 
Introduction to AJAX In WordPress
Introduction to AJAX In WordPressIntroduction to AJAX In WordPress
Introduction to AJAX In WordPress
 
Ajax
AjaxAjax
Ajax
 

Mais de Ramzi Alqrainy

Intel microprocessor history
Intel microprocessor historyIntel microprocessor history
Intel microprocessor history
Ramzi Alqrainy
 
Advance Data Structure
Advance Data StructureAdvance Data Structure
Advance Data Structure
Ramzi Alqrainy
 

Mais de Ramzi Alqrainy (20)

Non English Search as a Machine Learning Problem
Non English Search as a Machine Learning Problem Non English Search as a Machine Learning Problem
Non English Search as a Machine Learning Problem
 
OpenSooq Image Recognition on AWS - AWS ML Lab
OpenSooq Image Recognition on AWS - AWS ML LabOpenSooq Image Recognition on AWS - AWS ML Lab
OpenSooq Image Recognition on AWS - AWS ML Lab
 
A Few Milliseconds in the Life of an HTTP Request - AWS Summit 2019
A Few Milliseconds in the Life of an HTTP Request - AWS Summit 2019A Few Milliseconds in the Life of an HTTP Request - AWS Summit 2019
A Few Milliseconds in the Life of an HTTP Request - AWS Summit 2019
 
Mastering Chaos - OpenSooq’s journey from Monolithic to Microservices
Mastering Chaos - OpenSooq’s journey from Monolithic to Microservices Mastering Chaos - OpenSooq’s journey from Monolithic to Microservices
Mastering Chaos - OpenSooq’s journey from Monolithic to Microservices
 
Infrastructure OpenSooq Mobile @ Scale
Infrastructure OpenSooq Mobile @ ScaleInfrastructure OpenSooq Mobile @ Scale
Infrastructure OpenSooq Mobile @ Scale
 
Choosing the Right Technologies for OpenSooq
Choosing the Right Technologies for OpenSooqChoosing the Right Technologies for OpenSooq
Choosing the Right Technologies for OpenSooq
 
Retrieving Information From Solr
Retrieving Information From SolrRetrieving Information From Solr
Retrieving Information From Solr
 
MemSQL
MemSQLMemSQL
MemSQL
 
Arabic Content with Apache Solr
Arabic Content with Apache SolrArabic Content with Apache Solr
Arabic Content with Apache Solr
 
Recommender Systems, Part 1 - Introduction to approaches and algorithms
Recommender Systems, Part 1 - Introduction to approaches and algorithmsRecommender Systems, Part 1 - Introduction to approaches and algorithms
Recommender Systems, Part 1 - Introduction to approaches and algorithms
 
Apache Solr 4 Part 1 - Introduction, Features, Recency Ranking and Popularity...
Apache Solr 4 Part 1 - Introduction, Features, Recency Ranking and Popularity...Apache Solr 4 Part 1 - Introduction, Features, Recency Ranking and Popularity...
Apache Solr 4 Part 1 - Introduction, Features, Recency Ranking and Popularity...
 
Evaluating Search Engines
Evaluating Search EnginesEvaluating Search Engines
Evaluating Search Engines
 
Starting From Zero - Winning Strategies for Zero Results Page
Starting From Zero - Winning Strategies for Zero Results PageStarting From Zero - Winning Strategies for Zero Results Page
Starting From Zero - Winning Strategies for Zero Results Page
 
Search Behavior Patterns
Search Behavior PatternsSearch Behavior Patterns
Search Behavior Patterns
 
Intel microprocessor history
Intel microprocessor historyIntel microprocessor history
Intel microprocessor history
 
Linked stacks and queues
Linked stacks and queuesLinked stacks and queues
Linked stacks and queues
 
Advance Data Structure
Advance Data StructureAdvance Data Structure
Advance Data Structure
 
Hashing
HashingHashing
Hashing
 
Markov Matrix
Markov MatrixMarkov Matrix
Markov Matrix
 
STACK
STACKSTACK
STACK
 

Último

Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 

Último (20)

Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 

How to prevent the cache problem in AJAX

  • 1. How To Avoid Cashing AJAX ? Ramzi Sh. Alqrainy qcs_2008@yahoo.com 1
  • 2. How to clear the cache ? You can't actually clear the cache as it's controlled by the browser, but you can ask how to avoid caching AJAX ?? Ooooops, What is this problem ? Ramzi Sh. Alqrainy qcs_2008@yahoo.com 2
  • 3. What is the problem ?  AJAX application tends to frequently ask the server for the same URL (a stock quote, application status and so forth). The AJAX application expect a response form the server while, in fact, after the first request the browser returns the cached page and the AJAX application does not work as expected. So, What is the solution ? Ramzi Sh. Alqrainy qcs_2008@yahoo.com 3
  • 4. What is the solution ?  Imagine yourself you can not change HTML file. So, How to avoid caching AJAX?  If you want bypass the cache you can add some random argument to the url: What Happened ? Ramzi Sh. Alqrainy qcs_2008@yahoo.com 4
  • 5. What happened ?  Adding a pseudo-random parameter to the URL the AJAX application is requesting. Doing so will fool the browser to think this is a new page that has not yet been cached.  The Date().getTime(); returns a new value every millisecond (or so), the browser thinks this is a new page that has not been cached and requests the URL form the server. Ramzi Sh. Alqrainy qcs_2008@yahoo.com 5
  • 6. Thank You Ramzi Sh. Alqrainy qcs_2008@yahoo.com 6