Closed adammakowskidev closed 3 months ago
@adammakowskidev I will make a guidelines in english. The toml configuration like this. By the way, cache plugin is not stable, it will be changed.
[upstreams.cdn-upstream]
addrs = ["cn.bing.com:443"]
sni = "cn.bing.com"
read_timeout = "10s"
idle_timeout = "2m"
write_timeout = "10s"
[locations.cdn-location]
upstream = "cdn-upstream"
path = "/"
proxy_set_headers = [
"Host:cn.bing.com",
"Access-Control-Allow-Origin:*",
]
plugins = ["cdnCache"]
[servers.cdn]
addr = "127.0.0.1:6118"
access_log = "combined"
locations = ["cdn-location"]
threads = 1
tls_cert = """
-----BEGIN CERTIFICATE-----
MIIEljCCAv6gAwIBAgIQeYU....
-----END CERTIFICATE-----"""
tls_key = """
-----BEGIN PRIVATE KEY-----
MIIEvQIBADANBgkq.....
-----END PRIVATE KEY-----"""
enabled_h2 = true
[plugins.cdnCache]
category = "cache"
@vicanso Thank you for your response. I need some time to do some tests. Can the cache currently be configured in any way? Example TTL?
@vicanso Just testing, everything works fine! I just made it so that Caddy provides SSL, pingap handle proxy website + cache and Caddy serve SSL.
Currently, I don't know if there is an option to automatically receive SSL in Pingap?
@vicanso Thank you for your response. I need some time to do some tests. Can the cache currently be configured in any way? Example TTL?
Cache ttl is parse from http response header cache-control
So I have to overwrite this header? Many websites have their static files length set to one year. This is a bit long for the cache. Maybe it would be useful to set the cache age separately?
Cache-Control: public, max-age=xxx, s-maxage=xxx
, the s-maxage will be used as ttl. I'll find a way to set the maximum TTL later.
On Jun 6, 2024, at 10:18 PM, Adam Makowski @.***> wrote:
So I have to overwrite this header? Many websites have their static files length set to one year. This is a bit long for the cache. Maybe it would be useful to set the cache age separately?
— Reply to this email directly, view it on GitHubhttps://github.com/vicanso/pingap/issues/11#issuecomment-2152660156, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AADKYZ5S3VFGEATACOLYTKLZGBVSRAVCNFSM6AAAAABIZAGIICVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJSGY3DAMJVGY. You are receiving this because you were mentioned.Message ID: @.***>
@adammakowskidev Now you can set cache max ttl:
[plugins.commonCache]
category = "cache"
eviction = true
lock = "1s"
max_file_size = "1MB"
max_ttl = "5m"
predictor = true
If ttl get from cache-control
> 5 minutes, ttl will be set 5 minutes.
This question has been stale for a week. It will be closed in an additional day if not updated.
This issue has been closed because it has been stalled with no activity.
Hi @vicanso I am just testing Pingap I am wondering how I can create a proxy for a domain and use cache? Can you provide some example? The documentation is small In nginx I do it this way