• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Last-Modified Date

Contributor ,
Dec 01, 2006 Dec 01, 2006

Copy link to clipboard

Copied

I've noticed that ColdFusion does not seem to send an HTTP response header for Last-Modified date to the browser. This came up working with a Google mini search appliance, where my cfm pages don't have dates while the html ones do. I confirmed it using the Live HTTP headers add-on in Firefox (a nifty tool, by the way).

I guess it makes sense that a dynamic page would not have a date like a static html page. Has anyone done things to set this header? Many of the pages I display have dates associated with them (the date of a press release, for example), but I don't know if it would be a good practice to send this out as an HTTP response header.

Any thoughts are welcome.

-Paul
TOPICS
Advanced techniques

Views

333

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 02, 2006 Dec 02, 2006

Copy link to clipboard

Copied

two solutions for you
1) configure your webserver to send an expirey date for cfm files
or
2) on your .cfm pages have this line:
<cfheader name="Expires" value="Mon, 12 Sep 1990 20:53:15 GMT">

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Dec 02, 2006 Dec 02, 2006

Copy link to clipboard

Copied

LATEST
Yes,
We set these headers to take advantage of client caching.
This really improves the user's experience and cuts our bandwidth needs.

The only other thing is that you should also monitor for the "If-Modified-Since" header in the request
and send a 304 response if the file has not changed.

Attached is a quick and dirty demo.
In actual practice, the dates and etag are handled by the database.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation