Welcome! Log In Create A New Profile

Advanced

cache + add_after_body

Posted by Florian 
cache + add_after_body
August 17, 2011 06:37AM
Hi,

I use nginx as reverse proxy and I have caching enabled.

I also use the following code:
proxy_cache_use_stale timeout error http_502 http_503 http_504 invalid_header HTTP_500;

If the backend now raises error, the page loaded from the cache.
Now I would, however, that the user knows that he just visited the page from the cache. So I got him with a note about it in the HTML code to point. However, I do not know yet how to do that. I have tried it with add_after_body, but it did not work.

My Location:

location @proxy {
proxy_pass http://127.0.0.1:8082;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_cache cache;
proxy_cache_valid 5m;
gzip off;
proxy_cache_use_stale error timeout invalid_header http_500 http_502 http_503 http_504;
add_after_body /mainpage/index.html;

}
}


I hope someone can help.

Thanks in advance

Sincerely,
florian



Edited 1 time(s). Last edit at 08/17/2011 06:42AM by Florian.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 307
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready