CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Displaying fresh page each time

Print topic Send  topic

Author Message
clarion
Posted: 07/26/2002, 12:43 PM

I have an app developed in CC and uploaded it to a web server. When I connect to it, sometimes, I get pages from the browser's cache. For example, I have a record where the Item name is say "Biscuit". I change this record so that the item name is "Chocolate". Now, on the grid, it says "Chocolate". But if I try to edit "Chocolate", when the form comes up, it still says "Biscuit". If I hit refresh, it correctly changes to "Chocolate". How do I make sure that a fresh page is delivered each time without having to hit refresh? BTW, I am using PHP and MySQL on the server.

p.s. Most news sites _always_ show the latest page without having to hit refresh. I checked the response codes sent from the server and most of them are "Code 304 - Not modified". This could be the reason that I am getting this problem. How do I prevent Code 304 from being sent by apache?

Regards...
Efren Lugo
Posted: 07/26/2002, 2:20 PM

You may want to use META Tags...

there is METAS for making pages dont cache so you can view the latest generated page...

If you dont cache you will lose performance in you application...

much of the time clicking the back button gets the page but this one is in RAM so you cannot do much...

The META will make the job if you are clicking the links on your page...

but if user uses the back and forward buttons some page will get from Computer RAM.

METAS will only make the page dont save in the hard drive..
clarion
Posted: 07/27/2002, 8:30 AM

Agreed. But I don't want previous values of records to be shown to the user. Displaying correct data is more important than performance. Also, if it is possible to get Apache to respond with "Code 304 - Not modified" _only_ if the record has not changed -- that would be the best of both worlds.

The point I mentioned about news sites is that they do manage to show the latest page every time. For example, if you go to yahoo, it will always show the latest page. Seems more like a server side configuration than browser settings or even meta tags to me; particularly that checking the logs on my server show that more than 70% of the response codes is "Code 304".

Regards...
Mehmet Ozdemir
Posted: 07/28/2002, 4:11 PM

Clarion, did you check google,

I entered the following:

"code 304 meta tag" first hit was
META FAQ
... cache (if unchanged, the server returns status 304 ... Use the Robots tag. ... the difference
between HTTP-EQUIV and NAME META ... can I stop people seeing my source code ? ...
vancouver-webpages.com/META/FAQ.html - 10k

Desmond
Posted: 07/29/2002, 9:44 PM

This is a solution in ASP;
<%
Response.Buffer = True
Response.Expires = -1
%>

Place before <html>. This expires the page once it is sent to the client and causes a new one to be fetched upon request. I don't know what PHP might require.
Nicole
Posted: 07/31/2002, 4:29 AM

Hello,
CC already generates html meta tags to prevent caching:
<META HTTP-EQUIV="expires" CONTENT="0">
<HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">

You can also improve it with php code e.g. with the help of header() function. Details could be found in PHP manual.
http://www.php.net/manual/en/function.header.php
Also try to search on php forums for ready solution.

You can refer to following links devoted to cache problem:
http://www.mnot.net/cache_docs/
http://webmaster.info.aol.com/caching.html
and try to search on at www.w3c.org and thorugh Google to find out what other methods of cache control exist.

The other trick when redirecting to any page, always redirect to it with some random parameter(like timestamp)
e.g. search.php?name=doors&random=4575845748

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.