SetMIMEHeader ATTN:John P.

This WebDNA talk-list message is from

2001


It keeps the original formatting.
numero = 39165
interpreted = N
texte = Hello, I am trying to get rid of caching issues. I found this piece of code from John in the archives. A couple of questions: 1)by viewing the source of the page what do I look for to make sure it is working?2)how do I know what my UTC offset is?3) is this the right syntax to call it? [include file=MIMEHeaders.inc&expires=0]thanks.[!] ------- MIMEHeaders.inc ------- [/!] [!]5:00 is MY offset from UTC - replace with YOUR offset[/!] [!]Also remember to change when daylight savings time takes effect[/!] [math time&show=f]GMToffset={4:00:00}[/math][!] Configure useful variables [/!] [math time&show=f]GMT={[date %X]}+[GMToffset][/math] [math time&show=f]NOW={[date %X]}[/math][!] Check for input variable [/!] [if [expires]=[raw][expires][/raw]] [then] [math show=f]expiresat=3600[/math][/then] [else] [math show=f]expiresat=[expires]*60[/math][/else] [/if][!] Create the GMTexpires variable [/!] [math time&show=f]GMTexpires=[math][GMT]+[expiresat][/math][/math][!] Create the MIMEmodified string [/!] [text]MIMEmodified=[!] [/!][if ([GMT]>[NOW])][!] [/!][then][!] [/!][date format=%a, %d %b][!] [/!][/then][!] [/!][else][!]if GMT after midnight then increment date too [/!][format days_to_date %a, %d %b][math]{[date]}+{00/01/0000}[/math][/format][!] [/!][/else][!] [/!][/if][!] [/!] [date format=%Y] [Format Seconds_To_Time][GMT][/Format][!] [/!] GMT[/text][!] Create the MIMEexpires string [/!] [text]MIMEexpires=[!] [/!][if ([GMT]>[NOW]) and ([GMTexpires]>[GMT]) and ([GMTexpires]<86400)][!] ---- all in the same day ----[/!][then][!] [/!][date format=%a, %d %b %Y][!] [/!][/then][!] ---- at least one day later ---- [/!][else][!] [/!][format days_to_date %a, %d %b %Y][math]{[date]}+{00/[!] [/!][showif [GMTexpires]>86400][math]floor([GMTexpires]/86400)[/math][/showif][!] [/!][showif [GMTexpires]<86401]01[/showif][!] [/!]/0000}[/math][/format][!] [/!][/else][!] [/!][/if][!] [/!] [Format Seconds_To_Time][GMTexpires][/Format][!] [/!] GMT[/text] [!] Actually set the MIME headers [/!] [SETMIMEHEADER name=Last-modified&value=[MIMEmodified]] [SETMIMEHEADER name=Expires&value=[MIMEexpires]] -- Donovan D. Brooke Systems Administrator/ Assc. Art Director Epsen Hillmer GraphicsI know I'm making progress when I look at the questions I have asked in the past and think to myself... how stupid was that ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://search.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: SetMIMEHeader ATTN:John P. (John Peacock 2001)
  2. Re: SetMIMEHeader ATTN:John P. (Jeff Grady 2001)
  3. Re: SetMIMEHeader ATTN:John P. (John Peacock 2001)
  4. Re: SetMIMEHeader ATTN:John P. (Donovan Brooke 2001)
  5. Re: SetMIMEHeader ATTN:John P. (John Peacock 2001)
  6. SetMIMEHeader ATTN:John P. (Donovan Brooke 2001)
Hello, I am trying to get rid of caching issues. I found this piece of code from John in the archives. A couple of questions: 1)by viewing the source of the page what do I look for to make sure it is working?2)how do I know what my UTC offset is?3) is this the right syntax to call it? [include file=MIMEHeaders.inc&expires=0]thanks.[!] ------- MIMEHeaders.inc ------- [/!] [!]5:00 is MY offset from UTC - replace with YOUR offset[/!] [!]Also remember to change when daylight savings time takes effect[/!] [math time&show=f]GMToffset={4:00:00}[/math][!] Configure useful variables [/!] [math time&show=f]GMT={[date %X]}+[GMToffset][/math] [math time&show=f]NOW={[date %X]}[/math][!] Check for input variable [/!] [if [expires]=[raw][expires][/raw]] [then] [math show=f]expiresat=3600[/math][/then] [else] [math show=f]expiresat=[expires]*60[/math][/else] [/if][!] Create the GMTexpires variable [/!] [math time&show=f]GMTexpires=[math][GMT]+[expiresat][/math][/math][!] Create the MIMEmodified string [/!] [text]MIMEmodified=[!] [/!][if ([GMT]>[NOW])][!] [/!][then][!] [/!][date format=%a, %d %b][!] [/!][/then][!] [/!][else][!]if GMT after midnight then increment date too [/!][format days_to_date %a, %d %b][math]{[date]}+{00/01/0000}[/math][/format][!] [/!][/else][!] [/!][/if][!] [/!] [date format=%Y] [Format Seconds_To_Time][GMT][/Format][!] [/!] GMT[/text][!] Create the MIMEexpires string [/!] [text]MIMEexpires=[!] [/!][if ([GMT]>[NOW]) and ([GMTexpires]>[GMT]) and ([GMTexpires]<86400)][!] ---- all in the same day ----[/!][then][!] [/!][date format=%a, %d %b %Y][!] [/!][/then][!] ---- at least one day later ---- [/!][else][!] [/!][format days_to_date %a, %d %b %Y][math]{[date]}+{00/[!] [/!][showif [GMTexpires]>86400][math]floor([GMTexpires]/86400)[/math][/showif][!] [/!][showif [GMTexpires]<86401]01[/showif][!] [/!]/0000}[/math][/format][!] [/!][/else][!] [/!][/if][!] [/!] [Format Seconds_To_Time][GMTexpires][/Format][!] [/!] GMT[/text] [!] Actually set the MIME headers [/!] [SETMIMEHEADER name=Last-modified&value=[MIMEmodified]] [SETMIMEHEADER name=Expires&value=[MIMEexpires]] -- Donovan D. Brooke Systems Administrator/ Assc. Art Director Epsen Hillmer GraphicsI know I'm making progress when I look at the questions I have asked in the past and think to myself... how stupid was that ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://search.smithmicro.com/ Donovan Brooke

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

[FileInfo] on a remote file (2000) Quick ShowIf question (1997) [WebDNA] Format Days_To_Date (2008) problems with 2 tags (1997) Webdna sends your serial number on Internet (2003) Running _every_ page through WebCat-error.html (1997) WebCat2b13MacPlugIn - [showif][search][/showif] (1997) Stinkin' [Referrer] (1998) Locking up with WebCatalog... (1997) Re:What file? (1997) OT: need perl help, and question about switches (2007) WebCat2b13 Mac plugin - [sendmail] and checkboxes (1997) taxTotal, grandTotal (1997) PCS Frames (1997) forming a SKU (1999) MacAuthorize order data fields WAS:How To question... (1997) Webcat 2.0.1 date math bug -> Crash! (1997) Round up prices (2000) space (2002) Assigning carts (1998)