How do stop a page from being cached in either the browser or with Zope? I have added a meta tag like <META http-equiv="EXPIRES" CONTENT="31 Dec 99">, but it doesn't do anything so I think the page is being cached from zope somehow. Thanks
With this META the page should be cached till 12/31 this year. I don't think Zope is caching the page though. At 3:02 PM -0600 12/2/99, Adam Gotheridge wrote:
How do stop a page from being cached in either the browser or with Zope? I have added a meta tag like <META http-equiv="EXPIRES" CONTENT="31 Dec 99">, but it doesn't do anything so I think the page is being cached from zope somehow.
Thanks
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope No cross posts or HTML encoding! (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
# # # _____________________________________________ Joshua Brauer Box 915 http://www.brauer.org Fort Collins, CO 80522 Fax: (419) 793-4120 _____________________________________________ In flying I have learned that carelessness and overconfidence are usually far more dangerous than deliberately accepted risks. -- Wilbur Wright in a letter to his father, September 1900 ____________________________________________________
Adam Gotheridge wrote:
How do stop a page from being cached in either the browser or with Zope? I have added a meta tag like <META http-equiv="EXPIRES" CONTENT="31 Dec 99">, but it doesn't do anything so I think the page is being cached from zope somehow.
Thanks
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope No cross posts or HTML encoding! (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
PLEASEdon't use META tags to provide HTTP functionality. All web caches, and most web servers ignore meta tags, since they deal exculsively with the http protocol, and your meta tags are contained in the html. Instead, set a Cache-Control: no-cache tag in the Response. See the dtml guide for syntax. For future reference, here are useful caching headers in http Cache-Control: no-cache makes an object uncachable Cache-Control: max-age=30 causes a client to cache the object for, at most, 30 seconds. Cache-Control: s-maxage: only applies to public cache, not private (browser) caches. Cache-Control: private means a private cache (such as your browser cache) can cache it, but public caches like the ones on your ISP's network, cannot cache it. Cache-Control: no-store means don't store the object, same as Cache-Control: no-cache Cache-Control: no-cache=Connection means don't store the connection header Cache-Control: must-revalidate means that all caches must validate their stored object with the origin server, usually with an If-Modified-Since request Cache-Control: proxy-revalidate is the same as must-revalidate, but it doesn't apply to private caches (browser caches) Cache-Control: public makes an object cacheable, regardless of other headers that might imply that it is not cacheable. Any of these headers can be combined into a comma delimited list, such as Cache-Control: max-age=100, s-maxage=30, proxy-revalidate If you want to be backwards compatible with really old browsers, you should throw a Pragma: no-cache header in there, as well. Any new browsers will give Cache-Control headers preference over Pragma headers, and old browsers will not cache the object. The only other header that is object expiration secific is the Expires header, which requires a date in a legal HTTP format. This means rfc822 or rfc1123, and rfc1123 is preferred. It has the format 'Wed, 01 Dec 1999 13:42:23 GMT', so Expires: Wed, 01 Dec 1999 13:42:23 GMT is the full form. Alternatively, Expires: 0 can be used to specify an uncacheable object, according to the spec, but I have no idea whether browsers support that in a Meta tag or not. --sam
I still can't figure it out. The best I can come up with is <!--#call "RESPONSE.setStatus('Cache-Control: no-cache')"--> and that doesn't work ----- Original Message ----- From: Sam Gendler <sgendler@teknolojix.com> To: Adam Gotheridge <adam@foxvalley.net> Cc: zope <zope@zope.org> Sent: Thursday, December 02, 1999 5:05 PM Subject: Re: [Zope] disable page cacheing
Adam Gotheridge wrote:
How do stop a page from being cached in either the browser or with Zope? I have added a meta tag like <META http-equiv="EXPIRES" CONTENT="31 Dec 99">, but it doesn't do anything so I think the page is being cached from zope somehow.
Thanks
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope No cross posts or HTML encoding! (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
PLEASEdon't use META tags to provide HTTP functionality. All web caches, and most web servers ignore meta tags, since they deal exculsively with the http protocol, and your meta tags are contained in the html. Instead, set a Cache-Control: no-cache tag in the Response. See the dtml guide for syntax. For future reference, here are useful caching headers in http
Cache-Control: no-cache makes an object uncachable Cache-Control: max-age=30 causes a client to cache the object for, at most, 30 seconds. Cache-Control: s-maxage: only applies to public cache, not private (browser) caches. Cache-Control: private means a private cache (such as your browser cache) can cache it, but public caches like the ones on your ISP's network, cannot cache it. Cache-Control: no-store means don't store the object, same as Cache-Control: no-cache Cache-Control: no-cache=Connection means don't store the connection header Cache-Control: must-revalidate means that all caches must validate their stored object with the origin server, usually with an If-Modified-Since request Cache-Control: proxy-revalidate is the same as must-revalidate, but it doesn't apply to private caches (browser caches) Cache-Control: public makes an object cacheable, regardless of other headers that might imply that it is not cacheable.
Any of these headers can be combined into a comma delimited list, such as Cache-Control: max-age=100, s-maxage=30, proxy-revalidate
If you want to be backwards compatible with really old browsers, you should throw a Pragma: no-cache header in there, as well. Any new browsers will give Cache-Control headers preference over Pragma headers, and old browsers will not cache the object.
The only other header that is object expiration secific is the Expires header, which requires a date in a legal HTTP format. This means rfc822 or rfc1123, and rfc1123 is preferred. It has the format 'Wed, 01 Dec 1999 13:42:23 GMT', so Expires: Wed, 01 Dec 1999 13:42:23 GMT is the full form. Alternatively, Expires: 0 can be used to specify an uncacheable object, according to the spec, but I have no idea whether browsers support that in a Meta tag or not.
--sam
You should be using RESPONSE.setHeader('Cache-Control', 'no-cache') --sam Adam Gotheridge wrote:
I still can't figure it out. The best I can come up with is <!--#call "RESPONSE.setStatus('Cache-Control: no-cache')"-->
and that doesn't work
----- Original Message ----- From: Sam Gendler <sgendler@teknolojix.com> To: Adam Gotheridge <adam@foxvalley.net> Cc: zope <zope@zope.org> Sent: Thursday, December 02, 1999 5:05 PM Subject: Re: [Zope] disable page cacheing
Adam Gotheridge wrote:
How do stop a page from being cached in either the browser or with Zope? I have added a meta tag like <META http-equiv="EXPIRES" CONTENT="31 Dec 99">, but it doesn't do anything so I think the page is being cached from zope somehow.
Thanks
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope No cross posts or HTML encoding! (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
PLEASEdon't use META tags to provide HTTP functionality. All web caches, and most web servers ignore meta tags, since they deal exculsively with the http protocol, and your meta tags are contained in the html. Instead, set a Cache-Control: no-cache tag in the Response. See the dtml guide for syntax. For future reference, here are useful caching headers in http
Cache-Control: no-cache makes an object uncachable Cache-Control: max-age=30 causes a client to cache the object for, at most, 30 seconds. Cache-Control: s-maxage: only applies to public cache, not private (browser) caches. Cache-Control: private means a private cache (such as your browser cache) can cache it, but public caches like the ones on your ISP's network, cannot cache it. Cache-Control: no-store means don't store the object, same as Cache-Control: no-cache Cache-Control: no-cache=Connection means don't store the connection header Cache-Control: must-revalidate means that all caches must validate their stored object with the origin server, usually with an If-Modified-Since request Cache-Control: proxy-revalidate is the same as must-revalidate, but it doesn't apply to private caches (browser caches) Cache-Control: public makes an object cacheable, regardless of other headers that might imply that it is not cacheable.
Any of these headers can be combined into a comma delimited list, such as Cache-Control: max-age=100, s-maxage=30, proxy-revalidate
If you want to be backwards compatible with really old browsers, you should throw a Pragma: no-cache header in there, as well. Any new browsers will give Cache-Control headers preference over Pragma headers, and old browsers will not cache the object.
The only other header that is object expiration secific is the Expires header, which requires a date in a legal HTTP format. This means rfc822 or rfc1123, and rfc1123 is preferred. It has the format 'Wed, 01 Dec 1999 13:42:23 GMT', so Expires: Wed, 01 Dec 1999 13:42:23 GMT is the full form. Alternatively, Expires: 0 can be used to specify an uncacheable object, according to the spec, but I have no idea whether browsers support that in a Meta tag or not.
--sam
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope No cross posts or HTML encoding! (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Forget my previous message. You actually want to use RESPONSE.appendHeader('Cache-Control', 'no-cache'), since that will apend the header to the end of a comma delimited list of any previously set Cache-Control headers. --sam Adam Gotheridge wrote:
I still can't figure it out. The best I can come up with is <!--#call "RESPONSE.setStatus('Cache-Control: no-cache')"-->
and that doesn't work
----- Original Message ----- From: Sam Gendler <sgendler@teknolojix.com> To: Adam Gotheridge <adam@foxvalley.net> Cc: zope <zope@zope.org> Sent: Thursday, December 02, 1999 5:05 PM Subject: Re: [Zope] disable page cacheing
Adam Gotheridge wrote:
How do stop a page from being cached in either the browser or with Zope? I have added a meta tag like <META http-equiv="EXPIRES" CONTENT="31 Dec 99">, but it doesn't do anything so I think the page is being cached from zope somehow.
Thanks
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope No cross posts or HTML encoding! (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
PLEASEdon't use META tags to provide HTTP functionality. All web caches, and most web servers ignore meta tags, since they deal exculsively with the http protocol, and your meta tags are contained in the html. Instead, set a Cache-Control: no-cache tag in the Response. See the dtml guide for syntax. For future reference, here are useful caching headers in http
Cache-Control: no-cache makes an object uncachable Cache-Control: max-age=30 causes a client to cache the object for, at most, 30 seconds. Cache-Control: s-maxage: only applies to public cache, not private (browser) caches. Cache-Control: private means a private cache (such as your browser cache) can cache it, but public caches like the ones on your ISP's network, cannot cache it. Cache-Control: no-store means don't store the object, same as Cache-Control: no-cache Cache-Control: no-cache=Connection means don't store the connection header Cache-Control: must-revalidate means that all caches must validate their stored object with the origin server, usually with an If-Modified-Since request Cache-Control: proxy-revalidate is the same as must-revalidate, but it doesn't apply to private caches (browser caches) Cache-Control: public makes an object cacheable, regardless of other headers that might imply that it is not cacheable.
Any of these headers can be combined into a comma delimited list, such as Cache-Control: max-age=100, s-maxage=30, proxy-revalidate
If you want to be backwards compatible with really old browsers, you should throw a Pragma: no-cache header in there, as well. Any new browsers will give Cache-Control headers preference over Pragma headers, and old browsers will not cache the object.
The only other header that is object expiration secific is the Expires header, which requires a date in a legal HTTP format. This means rfc822 or rfc1123, and rfc1123 is preferred. It has the format 'Wed, 01 Dec 1999 13:42:23 GMT', so Expires: Wed, 01 Dec 1999 13:42:23 GMT is the full form. Alternatively, Expires: 0 can be used to specify an uncacheable object, according to the spec, but I have no idea whether browsers support that in a Meta tag or not.
--sam
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope No cross posts or HTML encoding! (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Forget my previous message. You actually want to use RESPONSE.appendHeader('Cache-Control', 'no-cache'), since that will apend the header to the end of a comma delimited list of any previously set Cache-Control headers.
--sam
Is there any way i can append this header information to images served ?? Browser caching of images is causing me a great deal of trouble, and i presently resort to the ?timestamp-hack , which is not by any means ideal.. ------------------------------------------------ Geir B Hansen geirh@funcom.com Web-designer / Graphic artist Funcom Oslo http://www.funcom.com ------------------------------------------------
I am fairly new to zope myself, but my first thought would be to make a ZClass that inherits from image and then somehow convince zope to send Cache-Control: no-cache headers whenever it serves an object of that type. The real question would be, why do you want to disable browser caching of images. Browsing an uncacheable website over a modem is a nightmare. Every time you hit the back button or put your mouse on a rollover, you have to wait for a new download. If it is just for development purposes, turn your cache off in netscape by setting the size of the caches to 0. In IE, You have to be sneakier. Make an exceedingly small disk partition (say 5-10KB), and then tell IE to put its Temporary Internet Files in that partition. Since IE insists on using at least 1% of the disk, you have to give it a VERY small disk. Hitting shift when you hit the reload button should send Cache-Control: no-cache instead of an If-Modified-Since header. However, the early versions of IE 5.0 disabled that feature so that microsoft could break all of the caching products that were released that were competing with MS Proxy. I have no idea if they have re-established the correct behaviour, but it is worth the test. -sam Geir B Hansen wrote:
Forget my previous message. You actually want to use RESPONSE.appendHeader('Cache-Control', 'no-cache'), since that will apend the header to the end of a comma delimited list of any previously set Cache-Control headers.
--sam
Is there any way i can append this header information to images served ?? Browser caching of images is causing me a great deal of trouble, and i presently resort to the ?timestamp-hack , which is not by any means ideal..
------------------------------------------------ Geir B Hansen geirh@funcom.com Web-designer / Graphic artist Funcom Oslo http://www.funcom.com ------------------------------------------------
participants (4)
-
Adam Gotheridge -
Geir B Hansen -
Joshua Brauer -
Sam Gendler