Title: Can&#8217;t set browser caching
Last modified: July 5, 2017

---

# Can’t set browser caching

 *  Resolved [putterill](https://wordpress.org/support/users/putterill/)
 * (@putterill)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/cant-set-browser-caching/)
 * I’m using Digital Ocean, Serverpilot and Cloudflare.
 * Cloudflare is connected correctly and shows browser caching is set up, pagespeed
   and your report says it isn’t, putting the suggested code into the ngnix.conf
   gives the error ” nginx: [emerg] “location” directive is not allowed here…”.
 * The instructions on where to place the code are very unclear, “Add the code above
   to the http or inside server section in the file.” I couldn’t see any server 
   section so I put it in the http section.

Viewing 1 replies (of 1 total)

 *  [Anton Vanyukov](https://wordpress.org/support/users/vanyukov/)
 * (@vanyukov)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/cant-set-browser-caching/#post-9290034)
 * Hi [@putterill](https://wordpress.org/support/users/putterill/),
 * You need to add the configuration to the server section of your host, it is usually
   located in the file /etc/nginx/site-enabled/[your-site].conf file. But it might
   be a different location, depending on the OS and the server configuration.
 * Best regards,
    Anton

Viewing 1 replies (of 1 total)

The topic ‘Can’t set browser caching’ is closed to new replies.

 * ![](https://ps.w.org/hummingbird-performance/assets/icon-256x256.gif?rev=2633221)
 * [Hummingbird Performance - Cache & Page Speed Optimization for Core Web Vitals | Critical CSS | Minify CSS | Defer CSS Javascript | CDN](https://wordpress.org/plugins/hummingbird-performance/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/hummingbird-performance/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/hummingbird-performance/)
 * [Active Topics](https://wordpress.org/support/plugin/hummingbird-performance/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/hummingbird-performance/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/hummingbird-performance/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Anton Vanyukov](https://wordpress.org/support/users/vanyukov/)
 * Last activity: [8 years, 10 months ago](https://wordpress.org/support/topic/cant-set-browser-caching/#post-9290034)
 * Status: resolved