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
-
Redirect if old browser or OS to other domain?
Hi, I use cloudflare free SSL option. All is fine except it wont work with windows XP . How do you think is it ok in case of old OS/Browser redirect visitors to other domain or subdomain? What could be impacts or consequences of such step? On the moment if page meko.lv is accessed from XP sp1,2 there is error. If it is possible how could such redirect look? Thanks
Technical SEO | | Mekounko0 -
Google Cache can't keep up with my 403s
Hi Mozzers, I hope everyone is well. I'm having a problem with my website and 403 errors shown in Google Webmaster Tools. The problem comes because we "unpublish" one of the thousands of listings on the site every few days - this then creates a link that gives a 403. At the same time we also run some code that takes away any links to these pages. So far so good. Unfortunately Google doesn't notice that we have removed these internal links and so tries to access these pages again. This results in a 403. These errors show up in Google Webmaster Tools and when I click on "Linked From" I can verify that that there are no links to the 403 page - it's just Google's Cache being slow. My question is a) How much is this hurting me? b) Can I fix it? All suggestions welcome and thanks for any answers!
Technical SEO | | HireSpace1 -
Odd scenario: subdomain not indexed nor cached, reason?
hi all hopefully somebody can help me with this issue 🙂 6 months ago a number of pages hosted at a domain level have been moved to a subdomain level with 301redirects + some others were created from scratch ( at a subdomain level too). what happens is that not only the new urls at the subdomain level are not indexed nor cached, but the old urls are still indexed in google, although by clicking on them they bring to the new urls via 301 redirect. question is why having a 301 redirects to the new urls, no issues with robot.txt, metarobots etc, the new urls are still de-indexed? i might remind you that a few (100 pages or so) have been created from scratch, but they are also not indexed. the only issue found across the page is the no-cache line of code set as follow: Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache i am not familiar with cache control lines. Can this be an issue from a correct indexing? thanks in advance Dario
Technical SEO | | Mrlocicero0 -
Why has my site cached date gone backwards
hi, something very unusual is happening with my site. a few months ago before we updated our site, i mean upgraded it, we would be indexed every day, now it seems we are getting indexed every four days, and now today i have noticed something very strange, this morning when i checked my site www.in2town.co.uk it was cached 31st july, but this afternoon it is showing 25th july. can anyone please let me know why this has happened many thanks
Technical SEO | | ClaireH-1848860 -
Cache Not Working on Our Site
We redesigned our site (www.motivators.com) back in April. Ever since then, we can't view the cache. It loads as a blank, white page but the cache text is at the top saying: "This is Google's cache of http://www.motivators.com/. It is a snapshot of the page as it appeared on Jul 22, 2013 15:50:40 GMT. The current page could have changed in the meantime. Learn more. Tip: To quickly find your search term on this page, press Ctrl+F or ⌘-F (Mac) and use the find bar." Has anyone else ever seen this happen? Any ideas as to why it's happening? Could it be hurting us? Advice, tips, suggestions would be very much appreciated!
Technical SEO | | Motivators0 -
Caching Problem !
Hi Webmasters, I have been getting a problem and that is caching problem. I have a SEO blog glanceseo.com and now i am facing caching problem. It takes something 2 months for caching. I want to solve it, please suggest me something... Thanks in advance
Technical SEO | | shubhamtiwari0 -
Can Google move up my ranking without caching it ?
Is it possible that my site was last cached in Google on 9 Oct (it was ranking 23 that time) and today on 29th oct its ranking position 3 for a kw though still showing cached on 9 oct. Its not cached since 9 oct, does that mean its not crawled since then? How can Google move up my ranking without caching it ?
Technical SEO | | Personnel_Concept0 -
Missing Cache - very strange
Anyone have experience with a cache going missing from a page that had a cache in the past? We’re overhauling a page and noticed the cache was gone from Google results. We don’t know if this event is good/bad/doesn’t matter but I am curious why this happens. I am positive the cache was missing before we updated the page today because a programmer mentioned they did try checking for a cache for a historical load time prior to today for a different project. I have attached two screenshots to illustrate two things: 1) What google delivers for a cache: of the page instead of the normal cache page 2) Even though you can see a cache of any of the indexed pages we have from a serp, the cached link is missing in serps for the mentioned page Has anyone seen this before? thanks! IhnAf SL8ax
Technical SEO | | CouponCactus0