This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
phptsmadmin/includes/jpgraph/docs/chunkhtml/ch05s03.html
2011-05-28 19:51:52 +10:00

24 lines
3.4 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Static vs dynamic images</title><link rel="stylesheet" type="text/css" href="manual.css"><meta name="generator" content="DocBook XSL Stylesheets V1.76.0"><link rel="home" href="index.html" title="JpGraph Manual"><link rel="up" href="ch05.html" title="Chapter 5. Fundamentals of dynamic graph generation"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Static vs dynamic images</th></tr><tr><td width="20%" align="left"> </td><th width="60%" align="center">Chapter 5. Fundamentals of dynamic graph generation</th><td width="20%" align="right"> </td></tr></table><hr></div><div class="sect1" title="Static vs dynamic images"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2494178"></a>Static vs dynamic images</h2></div></div></div>
<p>Having understood how we can generate images using a PHP script a new idea might
be forming. There is nothing that says that we have to create the same image using
the same data every time the graph script is called. We could for example randomly
select a pre-stored image in a directory and every time we call (the same) graph
script and new image is returned. Hence, with PHP scripts we can create dynamic
images that generate different images depending on some yet to be specified
parameters even though the script name stays the same. This is a new behaviour
compared with our normal images. </p>
<p>This could also lead to a new, and very real, problem which has to do with the
local caching most browsers do in order to avoid re-fetching already fetched objects
such as images. Normally a browser will check the time stamp on the file on the
server and compare with the latest fetched version it has stored locally. If the
browser sees that the file on the server is older than what it already has it will
not re-fetch the file. </p>
<p>Since a dynamic image is produced by a script and the script will stay the same
even if the produced image is changing (due to new data) the browser might still
think that the image has not changed since the script is the same and will not
bother re-fetching it again. The exact behavior of the browser cache is usually
adjustable by the end user and hence out of control for us who writes the script. A
simple way to always force the client to re-fetch the dynamic image is described in <a class="xref" href="ch05s05.html#sec2.forcing-browser-update" title="Forcing the browser to update your graph">Forcing the browser to update your graph</a></p>
</div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"> </td><td width="20%" align="center"><a accesskey="u" href="ch05.html">Up</a></td><td width="40%" align="right"> </td></tr><tr><td width="40%" align="left" valign="top"> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> </td></tr></table></div></body></html>