SlideShare a Scribd company logo
1 of 18
Dr . Majzoob Kamal Eldein Omer
 Provide finer cache control to both sender and recipient
 A new general Cache-Control directive that must be
obeyed!
 Cache Proxy, Client browser and server are obligated to
obey
Some of the directives in requests:
 Cache-control: no-cache Client forces up-to-date
check with origin server.
 Cache-control: max-age=1000 Client (user
or intermediate cache) is prepared to accept
object without up-to-date check if age is < 1000
seconds.
 Overrides expires: If document has not expired but
document age is > max-age, then cache performs an up-
to-date check.
 Cache-control : public The object is
cacheable by client and network
caches…basically anywhere!
 Cache-control: private The object can be
cached only by the client.
 Cache-control: max-age =1000 Server
imposes up-to-date check after 1000 seconds.
Similar to Expires header.
Server control:
 If origin server doesn’t want the object cached, it can
put in response cache-control:private .
 If origin server wants an up-to-date check for each
request, it can put in response cache-control: proxy-
revalidate .
 If origin server wants up-to-date check once the object
age > 1000, it can put in response: cache-control: max-
age=1000
Browser control:
 If client wants an up-to-date check even if the object
has not expired, it puts in request: Cache-control: no-
cache .
 In client is willing to accept the object that is less than
1000 seconds old without an up-to-date check, it can put
in request: Cache-control: max-age=1000 .
 CGI stands for Common Gateway Interface.
 CGI is a standard programming interface to Web
servers that gives us a way to make our sites
dynamic and interactive.
 CGI is not a programming language. It is just a
set of standards (protocols.)
 CGI can be implemented in an interpreted
language such as PERL or in a compiled language
such as C.
 CGI programs work as follows:
 STEP 1 (On the client side): Get Information from
the user (using HTML forms, SSI, Java Applet,
…,etc).
 STEP 2 (On the server side): Process the data,
connect to DATABASE, search for PATTERNS,
…,etc.
 STEP 3 (On the server side): Send the result of
computation back to the client.
 The steps involved in preparing a CGI
program for work.
1. Contact your Web host to find out where
you should put your CGI programs on the
server. Usually it will be a directory on
the server named “cgi-bin”.
2. Set up the access permission of directory
“cgi-bin”
3- Set up the access permission of the CGI
program
4- Test your CGI program from the server
command line to make sure it works
perfectly before publishing it.
 <form action=“cgi-prog.cgi”
method=“POST”>
. . .
</form>
 Two HTTP methods are available:
 GET
 POST
 The CGI program will be invoked every
time you the button SUBMIT is clicked.
 GET Method the data passed within the
query string of URL : for example:
http://std.edu/info/program?querystring
the data sent after the “?”
POST Method :
The data sent via entity body
 CGI Script Output Format :
 In whatever language a CGI script is
programmed it MUST send information back
in the following format:
 The Output Header
 A Blank Line
 The Output Data
 Content-Types
 The following are common formats/content-
types :
Format Content-Type
 HTML text/html
 Gif image/gif
 JPEG image/jpeg
 Depending on the Content-Type defined the data that follows
the header declaration :
 • If it is HTML that follows then the CGI script must output
standard HTML syntax.
 Example: To produce aWeb page that the server sends to a
browser with a simple line of text ”HelloWorld!” . A CGI script
must output:
 Content-Type: text/html
 <html>
 <head>
 <title>Hello, world!</title>
 </head>
 <body>
 <h1>Hello, world!</h1>
 </body>
 </html>
#!/usr/bin/perl
print "Content-Type: text/htmlnn";
print "<html> <head>n";
print "<title>Hello, world!</title>";
print "</head>n";
print "<body>n";
print "<h1>Hello, world!</h1>n";
print "</body> </html>n";

More Related Content

What's hot

Rails 4 & server sent events
Rails 4 & server sent eventsRails 4 & server sent events
Rails 4 & server sent eventsPiotr Karbownik
 
Scalable Reliable Secure REST
Scalable Reliable Secure RESTScalable Reliable Secure REST
Scalable Reliable Secure RESTguestb2ed5f
 
ASP.NET MVC and ajax
ASP.NET MVC and ajax ASP.NET MVC and ajax
ASP.NET MVC and ajax Brij Mishra
 
Server-Sent Events (real-time HTTP push for HTML5 browsers)
Server-Sent Events (real-time HTTP push for HTML5 browsers)Server-Sent Events (real-time HTTP push for HTML5 browsers)
Server-Sent Events (real-time HTTP push for HTML5 browsers)yay w00t
 
Webinar slides "Building Real-Time Collaborative Web Applications"
Webinar slides "Building Real-Time Collaborative Web Applications"Webinar slides "Building Real-Time Collaborative Web Applications"
Webinar slides "Building Real-Time Collaborative Web Applications"Sachin Katariya
 
Common gateway interface
Common gateway interfaceCommon gateway interface
Common gateway interfaceAnandita
 
How a Proxy Server Works
How a Proxy Server WorksHow a Proxy Server Works
How a Proxy Server WorksMer Joyce
 
Writing HTTP Middleware In Go
Writing HTTP Middleware In GoWriting HTTP Middleware In Go
Writing HTTP Middleware In GoShiju Varghese
 
SFDC Outbound Integrations
SFDC Outbound IntegrationsSFDC Outbound Integrations
SFDC Outbound IntegrationsSujit Kumar
 
Web service testing_final.pptx
Web service testing_final.pptxWeb service testing_final.pptx
Web service testing_final.pptxvodqancr
 
Time to REST: testing web services
Time to REST: testing web servicesTime to REST: testing web services
Time to REST: testing web servicesIurii Kutelmakh
 
40+ tips to use Postman more efficiently
40+ tips to use Postman more efficiently40+ tips to use Postman more efficiently
40+ tips to use Postman more efficientlypostmanclient
 
XAJA - Reverse AJAX framework
XAJA - Reverse AJAX frameworkXAJA - Reverse AJAX framework
XAJA - Reverse AJAX frameworkSri Prasanna
 

What's hot (20)

Rails 4 & server sent events
Rails 4 & server sent eventsRails 4 & server sent events
Rails 4 & server sent events
 
Angularjs & REST
Angularjs & RESTAngularjs & REST
Angularjs & REST
 
Wcf routing kt
Wcf routing ktWcf routing kt
Wcf routing kt
 
Common Gateway Interface
Common Gateway InterfaceCommon Gateway Interface
Common Gateway Interface
 
2310 b 06
2310 b 062310 b 06
2310 b 06
 
Scalable Reliable Secure REST
Scalable Reliable Secure RESTScalable Reliable Secure REST
Scalable Reliable Secure REST
 
ASP.NET MVC and ajax
ASP.NET MVC and ajax ASP.NET MVC and ajax
ASP.NET MVC and ajax
 
2310 b 13
2310 b 132310 b 13
2310 b 13
 
Server-Sent Events (real-time HTTP push for HTML5 browsers)
Server-Sent Events (real-time HTTP push for HTML5 browsers)Server-Sent Events (real-time HTTP push for HTML5 browsers)
Server-Sent Events (real-time HTTP push for HTML5 browsers)
 
Webinar slides "Building Real-Time Collaborative Web Applications"
Webinar slides "Building Real-Time Collaborative Web Applications"Webinar slides "Building Real-Time Collaborative Web Applications"
Webinar slides "Building Real-Time Collaborative Web Applications"
 
Common gateway interface
Common gateway interfaceCommon gateway interface
Common gateway interface
 
Inner core of Ajax
Inner core of Ajax Inner core of Ajax
Inner core of Ajax
 
How a Proxy Server Works
How a Proxy Server WorksHow a Proxy Server Works
How a Proxy Server Works
 
Writing HTTP Middleware In Go
Writing HTTP Middleware In GoWriting HTTP Middleware In Go
Writing HTTP Middleware In Go
 
SFDC Outbound Integrations
SFDC Outbound IntegrationsSFDC Outbound Integrations
SFDC Outbound Integrations
 
Web service testing_final.pptx
Web service testing_final.pptxWeb service testing_final.pptx
Web service testing_final.pptx
 
Time to REST: testing web services
Time to REST: testing web servicesTime to REST: testing web services
Time to REST: testing web services
 
40+ tips to use Postman more efficiently
40+ tips to use Postman more efficiently40+ tips to use Postman more efficiently
40+ tips to use Postman more efficiently
 
XAJA - Reverse AJAX framework
XAJA - Reverse AJAX frameworkXAJA - Reverse AJAX framework
XAJA - Reverse AJAX framework
 
Fm 2
Fm 2Fm 2
Fm 2
 

Similar to Cache control directive

Peer Cache for Configuration Manager clients
Peer Cache for Configuration Manager clientsPeer Cache for Configuration Manager clients
Peer Cache for Configuration Manager clientsKarthick Jokirathinam
 
Brushing skills on SignalR for ASP.NET developers
Brushing skills on SignalR for ASP.NET developersBrushing skills on SignalR for ASP.NET developers
Brushing skills on SignalR for ASP.NET developersONE BCG
 
Unit 1st and 3rd notes of java
Unit 1st and 3rd notes of javaUnit 1st and 3rd notes of java
Unit 1st and 3rd notes of javaNiraj Bharambe
 
Subscription based control system to automate management of events for robots
Subscription based control system to automate management of events for robotsSubscription based control system to automate management of events for robots
Subscription based control system to automate management of events for robotsdbpublications
 
Configuring the Apache Web Server
Configuring the Apache Web ServerConfiguring the Apache Web Server
Configuring the Apache Web Serverwebhostingguy
 
Using communication and messaging API in the HTML5 world - GIl Fink, sparXsys
Using communication and messaging API in the HTML5 world - GIl Fink, sparXsysUsing communication and messaging API in the HTML5 world - GIl Fink, sparXsys
Using communication and messaging API in the HTML5 world - GIl Fink, sparXsysCodemotion Tel Aviv
 
Consuming GRIN GLOBAL Webservices
Consuming GRIN GLOBAL WebservicesConsuming GRIN GLOBAL Webservices
Consuming GRIN GLOBAL WebservicesEdwin Rojas
 
Penetration Testing Report
Penetration Testing ReportPenetration Testing Report
Penetration Testing ReportAman Srivastava
 
Chapter5-Bypass-ClientSide-Control-Presentation.pptx
Chapter5-Bypass-ClientSide-Control-Presentation.pptxChapter5-Bypass-ClientSide-Control-Presentation.pptx
Chapter5-Bypass-ClientSide-Control-Presentation.pptxilhamilyas5
 
Scaling asp.net websites to millions of users
Scaling asp.net websites to millions of usersScaling asp.net websites to millions of users
Scaling asp.net websites to millions of usersoazabir
 
13 asp.net session19
13 asp.net session1913 asp.net session19
13 asp.net session19Vivek chan
 
Client control
Client controlClient control
Client controlSireesh K
 
Native client
Native clientNative client
Native clientzyc901016
 

Similar to Cache control directive (20)

Python cgi programming
Python cgi programmingPython cgi programming
Python cgi programming
 
CGI by rj
CGI by rjCGI by rj
CGI by rj
 
Ecom 1
Ecom 1Ecom 1
Ecom 1
 
Peer Cache for Configuration Manager clients
Peer Cache for Configuration Manager clientsPeer Cache for Configuration Manager clients
Peer Cache for Configuration Manager clients
 
Cgi
CgiCgi
Cgi
 
contentDM
contentDMcontentDM
contentDM
 
Unit 02: Web Technologies (2/2)
Unit 02: Web Technologies (2/2)Unit 02: Web Technologies (2/2)
Unit 02: Web Technologies (2/2)
 
Brushing skills on SignalR for ASP.NET developers
Brushing skills on SignalR for ASP.NET developersBrushing skills on SignalR for ASP.NET developers
Brushing skills on SignalR for ASP.NET developers
 
Cgi
CgiCgi
Cgi
 
Unit 1st and 3rd notes of java
Unit 1st and 3rd notes of javaUnit 1st and 3rd notes of java
Unit 1st and 3rd notes of java
 
Subscription based control system to automate management of events for robots
Subscription based control system to automate management of events for robotsSubscription based control system to automate management of events for robots
Subscription based control system to automate management of events for robots
 
Configuring the Apache Web Server
Configuring the Apache Web ServerConfiguring the Apache Web Server
Configuring the Apache Web Server
 
Using communication and messaging API in the HTML5 world - GIl Fink, sparXsys
Using communication and messaging API in the HTML5 world - GIl Fink, sparXsysUsing communication and messaging API in the HTML5 world - GIl Fink, sparXsys
Using communication and messaging API in the HTML5 world - GIl Fink, sparXsys
 
Consuming GRIN GLOBAL Webservices
Consuming GRIN GLOBAL WebservicesConsuming GRIN GLOBAL Webservices
Consuming GRIN GLOBAL Webservices
 
Penetration Testing Report
Penetration Testing ReportPenetration Testing Report
Penetration Testing Report
 
Chapter5-Bypass-ClientSide-Control-Presentation.pptx
Chapter5-Bypass-ClientSide-Control-Presentation.pptxChapter5-Bypass-ClientSide-Control-Presentation.pptx
Chapter5-Bypass-ClientSide-Control-Presentation.pptx
 
Scaling asp.net websites to millions of users
Scaling asp.net websites to millions of usersScaling asp.net websites to millions of users
Scaling asp.net websites to millions of users
 
13 asp.net session19
13 asp.net session1913 asp.net session19
13 asp.net session19
 
Client control
Client controlClient control
Client control
 
Native client
Native clientNative client
Native client
 

Recently uploaded

Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 

Recently uploaded (20)

Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 

Cache control directive

  • 1. Dr . Majzoob Kamal Eldein Omer
  • 2.  Provide finer cache control to both sender and recipient  A new general Cache-Control directive that must be obeyed!  Cache Proxy, Client browser and server are obligated to obey Some of the directives in requests:  Cache-control: no-cache Client forces up-to-date check with origin server.
  • 3.  Cache-control: max-age=1000 Client (user or intermediate cache) is prepared to accept object without up-to-date check if age is < 1000 seconds.  Overrides expires: If document has not expired but document age is > max-age, then cache performs an up- to-date check.
  • 4.  Cache-control : public The object is cacheable by client and network caches…basically anywhere!  Cache-control: private The object can be cached only by the client.  Cache-control: max-age =1000 Server imposes up-to-date check after 1000 seconds. Similar to Expires header.
  • 5. Server control:  If origin server doesn’t want the object cached, it can put in response cache-control:private .  If origin server wants an up-to-date check for each request, it can put in response cache-control: proxy- revalidate .  If origin server wants up-to-date check once the object age > 1000, it can put in response: cache-control: max- age=1000
  • 6. Browser control:  If client wants an up-to-date check even if the object has not expired, it puts in request: Cache-control: no- cache .  In client is willing to accept the object that is less than 1000 seconds old without an up-to-date check, it can put in request: Cache-control: max-age=1000 .
  • 7.
  • 8.  CGI stands for Common Gateway Interface.  CGI is a standard programming interface to Web servers that gives us a way to make our sites dynamic and interactive.  CGI is not a programming language. It is just a set of standards (protocols.)  CGI can be implemented in an interpreted language such as PERL or in a compiled language such as C.
  • 9.  CGI programs work as follows:  STEP 1 (On the client side): Get Information from the user (using HTML forms, SSI, Java Applet, …,etc).  STEP 2 (On the server side): Process the data, connect to DATABASE, search for PATTERNS, …,etc.  STEP 3 (On the server side): Send the result of computation back to the client.
  • 10.
  • 11.  The steps involved in preparing a CGI program for work. 1. Contact your Web host to find out where you should put your CGI programs on the server. Usually it will be a directory on the server named “cgi-bin”. 2. Set up the access permission of directory “cgi-bin”
  • 12. 3- Set up the access permission of the CGI program 4- Test your CGI program from the server command line to make sure it works perfectly before publishing it.
  • 13.  <form action=“cgi-prog.cgi” method=“POST”> . . . </form>  Two HTTP methods are available:  GET  POST  The CGI program will be invoked every time you the button SUBMIT is clicked.
  • 14.  GET Method the data passed within the query string of URL : for example: http://std.edu/info/program?querystring the data sent after the “?” POST Method : The data sent via entity body
  • 15.  CGI Script Output Format :  In whatever language a CGI script is programmed it MUST send information back in the following format:  The Output Header  A Blank Line  The Output Data
  • 16.  Content-Types  The following are common formats/content- types : Format Content-Type  HTML text/html  Gif image/gif  JPEG image/jpeg
  • 17.  Depending on the Content-Type defined the data that follows the header declaration :  • If it is HTML that follows then the CGI script must output standard HTML syntax.  Example: To produce aWeb page that the server sends to a browser with a simple line of text ”HelloWorld!” . A CGI script must output:  Content-Type: text/html  <html>  <head>  <title>Hello, world!</title>  </head>  <body>  <h1>Hello, world!</h1>  </body>  </html>
  • 18. #!/usr/bin/perl print "Content-Type: text/htmlnn"; print "<html> <head>n"; print "<title>Hello, world!</title>"; print "</head>n"; print "<body>n"; print "<h1>Hello, world!</h1>n"; print "</body> </html>n";