Fixed expiration, and cache-control: max-age implementation.
Also use `FILE.date` instead of `FILE.change_date` (`change_date` is the date of the last status change, quite often same as creation date, while `date` is the last modification date).
This commit is contained in:
@@ -508,9 +508,16 @@ feature -- Others
|
||||
|
||||
put_expires (a_seconds: INTEGER)
|
||||
-- Put "Expires" header to `a_seconds' seconds
|
||||
-- and also "Cache-Control: max-age=.." .
|
||||
-- To be supported by most browser.
|
||||
local
|
||||
dt: DATE_TIME
|
||||
do
|
||||
put_expires_string (a_seconds.out)
|
||||
end
|
||||
create dt.make_now_utc
|
||||
dt.second_add (a_seconds)
|
||||
put_expires_date (dt)
|
||||
put_cache_control ("max-age=" + a_seconds.out)
|
||||
end
|
||||
|
||||
put_expires_string (a_expires: STRING)
|
||||
-- Put "Expires" header with `a_expires' string value
|
||||
|
||||
Reference in New Issue
Block a user