> # Ключ по которому сохраняются и берутся > данные из кеша > proxy_cache_key > "$request_method|$http_if_modified_since|$http_if_none_match|$host|$re > quest_uri"; Стоит подумать про оптимизацию proxy_cache_key, у вас в ключе есть лишнby S.A.N - Nginx Mailing List - Russian
> > если ревалидация не проходит - элемент кеша не будет > > удалён/заменён, а будет продолжать использоваться для других > > пользователей. > Если у клиента нет прав доступа, он получает статус 403, если есть >by S.A.N - Nginx Mailing List - Russian
> А можете ли подсказать насчёт этого? > >Остаётся ещё вариант изменить пути на самом бакэнде, чтобы они > начинались с имени поддиректории, для которой делается проксирование. > >Просьба подсказать как это лучby S.A.N - Nginx Mailing List - Russian
> SEO по общему использованию кукисов на двух разных бакэндах при общем > главном домене. На главном домене, отдавайте куки с параметром domain .example.com Тогда куки будут видны всем подоменам *.example.com С аяксом тоже есть реby S.A.N - Nginx Mailing List - Russian
> Остаётся ещё вариант изменить пути на самом бакэнде, чтобы они > начинались с имени поддиректории, для которой делается проксирование. > Просьба подсказать как это лучше сделать в случае nginx. Лучше установить беby S.A.N - Nginx Mailing List - Russian
Роман Москвитин Wrote: ------------------------------------------------------- > Кому как, мне вот только что ответил двухсоткой. Несколько раз. > Различный > контент пошел уже с 304, но там и max-age далеко не ноль. > Про использование кук и прочихby S.A.N - Nginx Mailing List - Russian
> Извините что вклиниваюсь, но это полная победа разума над логикой. > А идти вразрез с логикой правильно только в алгоритмах защиты, дабы > спутать > врага. Я же не настаиваю на этом решении, это уже вам решать.by S.A.N - Nginx Mailing List - Russian
> - Добавлять комментарий без перезагрузки страницы javascript'ом, > отправлять на сервер - через ajax. Так, насколько я понимаю, > сейчас делают чуть менее, чем все, в том числе упоминаемый вами же > facebook. Я же написby S.A.N - Nginx Mailing List - Russian
> А что вам мешает организовать кеш в мемкеше или другом подобном > хранилище? > Мы у себя так сделали, кеш (на nginx) выключили вообще за > ненадобностью. Мы так же реализуем, слой кеширования в Memcache, в нем кешируютсяby S.A.N - Nginx Mailing List - Russian
Уточнения, там где контент совсем статичный мы кешируем его на долго без ревалидации. Постоянная ревалидация нам нужна только на динамичном контенте, все написанное выше имеет отношения только к динамичному контенту.by S.A.N - Nginx Mailing List - Russian
> use case и о происхождении требования о недопустимости кеширования > даже на 1 секунду. Возможно, это позволило бы пересмотреть > существующее поведение при max-age=0, благо в Cache-Control есть и > другие способы запрета кеby S.A.N - Nginx Mailing List - Russian
> Они > вообще ничего не требуют кешировать. Кеш - дело сугубо > добровольное. ;) max-age=0 не требует кешировать ответ, смысл в том что он не запрещает кешировать ответ, в Nginx max-age=0 запрещает кеширования, в этом и есть нby S.A.N - Nginx Mailing List - Russian
> А use case какой? С учётом характерных времён доступа по http - > запрет кеширования даже на 1 секунду выглядит странно. Есть смысл в кешировании с max-age=0, на страницах где недопустима задержка даже в 1 сек, в отображении аby S.A.N - Nginx Mailing List - Russian
Есть досадные мелочи, которые хотелось бы исправить, при включении fastcgi_cache_revalidate on, параметр HTTP_IF_MODIFIED_SINCE, всегда отправляется на сервер, даже если кеша нет, бекенду будет отправлен параметр с пустым значением. По станby S.A.N - Nginx Mailing List - Russian
Проблем с HTTP/1.0 не будет в принципе, бекенд не работает на прямую с клиентом по HTTP/1.0, бекенд работает с Nginx, который в свою очередь должен передать HTTP_IF_NONE_MATCH взятым из файла кеша Nginx, бекенд проведет ревалидацию и ответит 3by S.A.N - Nginx Mailing List - Russian
Если в нашей дискуссии есть практический смысл (реализация Etag в ближайших версия). Я могу много рассказать про невозможность использовать Last-Modified для ревалидации. Реальный пример из жизни, у нас есть страница товара,by S.A.N - Nginx Mailing List - Russian
Отличия ETag от Last-Modified, в формате значений, в ETag произвольный формат и многие разработчики это используют для передачи хеш состояний ответа, некоторые даже используют значения ETag для передачи серелизированой строки в кby S.A.N - Nginx Mailing List - Russian
Можно где-то подробней почитать, про новые возможности для инвалидации кеша? If-Modified-Since - работает по дате, это хорошо, но для полноты возможностей, нужна поддержка ETag, но все равно спасибо вам, приятно видеть что идет проby S.A.N - Nginx Mailing List - Russian
В принципе есть довольно простое решения с отправкой на бекенд хедера Etag из файла кеша, вам нужно сделать заполнения переменой $upstream_http_etag, она сейчас всегда пустая даже если в файле кеша есть хедер Etag, если эта переменнby S.A.N - Ideas and Feature Requests
Нашел :) Переменная есть - $upstream_cache_status; Но будет, интересно услышать идеи как можно улучшить данную схему кеширования .by S.A.N - Nginx Mailing List - Russian
В идеале хотелось бы иметь возможность, в Nginx прозрачного реверс-прокси кеширования, я здесь тоже опишу данную схему, надеюсь это не будет воспринято за флуд :) Схема сложней в реализации, но если разработчики Nginx посчиby S.A.N - Ideas and Feature Requests
Для инвалидации кеша, мы планировали использовать следующую схему: fastcgi_cache_valid 200 … 1s; fastcgi_cache_use_stale error updating http_503; По истечения 1 секунды, запрос будет идти на бекенд, на котором РНР скрипт определяет изменились данныеby S.A.N - Ideas and Feature Requests
Для инвалидации кеша, мы планировали использовать такую схему: fastcgi_cache_valid 200 … 1s; fastcgi_cache_use_stale error updating http_503; По истечения 1 секунды, запрос будет идти на бекенд, на котором РНР скрипт определяет изменились данные в БДby S.A.N - Nginx Mailing List - Russian