[ Поиск ] - [ Пользователи ] - [ Календарь ]
Полная Версия: Expires
Страницы: 1, 2
te0203
Как изменить заголовок Expires?
Сервер по умолчанию посылает такую строку:
Expires: Thu, 19 Nov 1981 08:52:00 GMT

Попытки послать заголовок принудительно не помог,
header("Expires:" .  date("r"));

в файле .htaccess тоже пытался изменить,
# Заголовок Expires
<ifmodule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 30 days"
</ifmodule>

Помогите, иожалуйста.
Семён
Вам для чего такой дедовский способ?
te0203
Как то не верно, актуальность страницы 1981 годом.
Семён
На сколько я знаю Expires (или Cache-Control) применяется только для того - чтобы закешировать данные или некоторые компоненты на странице.
Современные браузеры, помоему на автомате это всё делают.
te0203
Заголовок Expires важен для индексации поисковиками.
Семён
te0203
Насколько я знаю, тому же Яндексу плевать на Expires, ему интересен только Last-Modified
te0203
Last-Modified это дата создания страницы, а Expires когда страница считается устаревшей и обязательна к новой индексации.
Семён
Вам нужно скорее всего:
<META HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 2004 08:21:57 GMT">
te0203
При наличии заголовка сервера метатеги игнорируются и считаются не обязательными к исполнению.
Семён
te0203
У вас явно с английским плохо и делами оптимизации,
Last-Modified - это не дата создания, это дата изменения страницы.
te0203
Цитата (Семён @ 4.11.2011 - 08:42)
te0203
У вас явно с английским плохо и делами оптимизации,
Last-Modified - это не дата создания, это дата изменения страницы.

Извини, не так выразился, но суть от этого не меняется.
Семён
Я может что не так понял:
Цитата
14.9.3 Modifications of the Basic Expiration Mechanism

The expiration time of an entity MAY be specified by the origin server using the Expires header (see section 14.21). Alternatively, it MAY be specified using the max-age directive in a response. When the max-age cache-control directive is present in a cached response, the response is stale if its current age is greater than the age value given (in seconds) at the time of a new request for that resource. The max-age directive on a response implies that the response is cacheable (i.e., "public") unless some other, more restrictive cache directive is also present.

If a response includes both an Expires header and a max-age directive, the max-age directive overrides the Expires header, even if the Expires header is more restrictive. This rule allows an origin server to provide, for a given response, a longer expiration time to an HTTP/1.1 (or later) cache than to an HTTP/1.0 cache. This might be useful if certain HTTP/1.0 caches improperly calculate ages or expiration times, perhaps due to desynchronized clocks.

Many HTTP/1.0 cache implementations will treat an Expires value that is less than or equal to the response Date value as being equivalent to the Cache-Control response directive "no-cache". If an HTTP/1.1 cache receives such a response, and the response does not include a Cache-Control header field, it SHOULD consider the response to be non-cacheable in order to retain compatibility with HTTP/1.0 servers.
te0203
Ну если бы я знал английский....
Подскажите, пожалуйста, новичку , что там написано...
te0203
Я так понимаю, мы сейчас спорим нужен этот заголовок или нет, но вопрос так не стоит, есть задача его изменить....
VELIK505
В .htaccess добавьте строку:
CharsetOverrideExpires Off
Быстрый ответ:

 Графические смайлики |  Показывать подпись
Здесь расположена полная версия этой страницы.
Invision Power Board © 2001-2024 Invision Power Services, Inc.