How to add expires headers

  • Unknown's avatar

    I have a page on WordPress.com where I want to add expires headers.
    I see that in WordPress.com there is no htaccess and that the server is nginx, what is the way to add this type of headers?
    For example:

    location ~*  .(jpg|jpeg|gif|png|svg)$ {
    		expires 365d;
    	}
    
    	location ~*  .(pdf|css|html|js|swf)$ {
    		expires 2d;
    	}

    Edit: I tried with the plugin Hummingbird but it says the cache types don’t meet the recommended period type and it won’t get activated.

    The blog I need help with is: (visible only to logged in users)

  • Hi @blacksun1661, can you confirm this site is hosted here on our services?
    https://wordpress.com/support/com-vs-org/

    I ask because the free site wouldn’t accept a plugin, but you are right that we use nginx here rather than .htaccess. If the site is hosted here and just under another account, can you send a link to that? While these forums are primarily for the free sites here, we’d be happy to check in with the folks who support ourBusiness and eCommerce Plans; they’ll know more. We will just need a link to the correct site.

  • The topic ‘How to add expires headers’ is closed to new replies.