Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

Nginx configuration to override specific browser pages expiration time

$
0
0

Replies: 0

Hi,

I use the Page Cache and Browser Cache with nginx.
I’m satified with the base value of the Browser Cache for HTML pages, but for some specific pages I want the caching time to be far lower .

But I could not successfully change the expire time of the specific page.

I have added in the top of my nginx configuration file :

location ^~ /my-specific-page/ {
    expires 60s;
    etag on;
    if_modified_since exact;
    add_header Pragma "public";
    add_header Cache-Control "public";
    try_files $uri $uri/ /index.php?$args;
}

but with no success.

I put it juste before the Page Cache block :


# BEGIN W3TC Page Cache cache
location ~ /app/cache/page_enhanced.*gzip$ {
[...]
}

How can I modify the expire time of specific pages ?
By slug of post id, whatever for me.

  • This topic was modified 20 seconds ago by antoninum.

Viewing all articles
Browse latest Browse all 59525

Trending Articles