Leverage browser caching Nginx
-
Hi there,
Does anyone have any experience with leverage browser caching on Nginx?
Every time I run the pagespeed test from Google my site comes up with this as a high priority issue that needs to be addressed.
I can see that it is mostly images that doesn't have an expiry date and tried putting the following into my conf file:
location ~* .(jpg|jpeg|gif|css|png|js|ico)$ {
expires max;
}But this results in breaking my page off and all elements where out of place and missing images.
Also tried excluding css and js but hen all images where still missing.
My site is running on Drupal and I use APC for PHP to increase the load time on the site.
Hope somebody might be able to help me out.
-
Man, you have a difficult case... I not sure what is happening, but in my page I used this code:
<filesmatch ".(ico|jpg|jpeg|png|gif|swf|css|js)$"=""></filesmatch> Header set Expires "Sun, 30 Apr 2090 20:00:00 GMT" Header set Last-Modified "wed, 20 fev 2012 09:00:00 GMT"
You should try this. And try to clean your browser cache.
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Site Audit Tools Not Picking Up Content Nor Does Google Cache
Hi Guys, Got a site I am working with on the Wix platform. However site audit tools such as Screaming Frog, Ryte and even Moz's onpage crawler show the pages having no content, despite them having 200 words+. Fetching the site as Google clearly shows the rendered page with content, however when I look at the Google cached pages, they also show just blank pages. I have had issues with nofollow, noindex on here, but it shows the meta tags correct, just 0 content. What would you look to diagnose? I am guessing some rogue JS but why wasn't this picked up on the "fetch as Google".
Technical SEO | | nezona0 -
Google Bot is seeing the desktop version in cache for Mobile website too.
Hi, I have an e-commerce website that is dynamic(not responsive) in nature. when i check the cached version of mobile website it shows the desktop version in cache. Will it create any problem . How can i tell google bot to see my mobile cached version instead of desktop one.
Technical SEO | | dhananjay.kumar10 -
Combining variants of "last modified", cache-duration etc
Hiya, As you know, you can specify the date of the last change of a document in various places, for example the sitemap, the http-header, ETag and also add an "expected" change, for example Cache-Duration via header/htaccess (or even the changefreq in the sitemap). Is it advisable or rather detrimental to use multiple variants that essentially tell browser/search engines the same thing? I.e. should I send a lastmod header AND ETag AND maybe something else? Should I send a cache duration at all if I send a lastmod? (Assume that I can keep them correct and consistent as the data for each will come from the very same place.) Also: Are there any clear recommendations on what change-indicating method should be used? Thanks for your answers! Nico
Technical SEO | | netzkern_AG0 -
Issue with Cached pages
I have a client who has a three domains:
Technical SEO | | paulbaguley
budgetkits.co.uk
prosocceruk.co.uk
cheapfootballkits.co.uk Budget Kits is not active but Pro Soccer and Cheap Football Kits are. The issue is when you do site:budgetkits.co.uk on Google it brings back results. If you click on the link it goes to page saying website doesn't exist which is correct but if you click on cached it shows you a page from prosocceruk.co.uk or cheapfootballkits.co.uk. The cached pages are very recent by a couple of days ago to a week. The first result brings up www.budgetkits.co.uk/rainwear but the cached page is www.prosocceruk.co.uk/rainwear The third result brings up www.budgetkits.co.uk/kids-football-kits but the cached page is http://www.cheapfootballkits.co.uk The history of this issue is that budgetkits.co.uk was its own website 7 years ago and then it used to point at prosocceruk.co.uk after that but it no longer does for about two months. All files have been deleted from budgetkits.co.uk so it is just a domain. Any help with this would be very much appreciated as I have not seen this kind of issue before.0 -
Nginx vs. Apache, All Things Considered
Hey Peeps, I've been struggling lately with a new static site, and I'm looking for anyone's opinion who's had to optimize a site using Nginx. I understand that Nginx is recommended for static sites, however I want to avoid being in a situation where I can't do things like write redirect rules the way I want to. Considering that it will be hosting a Static site, are there any features or functions that Nginx lacks when compared to Apache, such as ability to write rewrite rules, etc.?
Technical SEO | | danny.wood1 -
Google caching the "cookie law message"
Hello! So i've been looking at the cached text version of our website. (Google Eyes is a great add on for this) One thing I've noticed is that, Google caches our EU Cookie Law message. The message appears on the top of the page and Google is caching this. The message is enclosed within and but it still is being cached. I'm going to ask the development mean to move the message at the bottom of the page and fix the position, but reviewing other websites with cookie messages, Google isn't caching them in their text only versions. Any tips or advice?
Technical SEO | | Bio-RadAbs0 -
Cache pages in search results
My URL is: pure mobile . ca when searching on google for "puremobile note 2 defender" the search results are coming up with the incorrect title pages of my search results - for some reason all the search results are coming up with "unlocked cell phone" at the end of the title. but on the android and on my desktop - they show the correct title of my pages. we used to deal with unlocked cell phone ( over a year ago) - and all meta tags and title tags have been fully updated. how can i let google know to update these results.
Technical SEO | | puremobile0 -
Google Cache Version and Text Only Version are different
Across various websites we found Google cache version in the browser loads the full site and all content is visible. However when we try to view TEXT only version of the same page we can't see any content. Example: we have a client with JS scroller menu on the home page. Each scroller serves a separate content section on the same URL. When we copy paste some of the page content in Google, we can see that copy indexed in Google search results as well as showing in Cache version . But as soon as we go into Text Only version we cant see the same copy. We would like to know which version we should trust, Google cache version or the TEXT only version.
Technical SEO | | JamesDixon700