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
-
Browser Size = Not Set Filter in Google Analytics
I have been trying to filter this traffic out of my Google Analytics data since it all seems to be related to spam traffic. I have had multiple instances wherein using this filter:
Technical SEO | | fuelmedical
(Backslash not displaying in message preview - I have written backlash to indicate its placement in the filter) Custom Filter - Exclude - Browser Size - ^backlash(not setbackslash)$ Traffic seems to appropriately filter out - but then the filter ceases working. In looking at a new site with Browser Size = (not set) traffic the filter preview doesn't appear to work either. Am I implementing the filter incorrectly? How do I filter this traffic out of GA data sucessfully? If I use the exact same method using RegEx in Google Data Studio - the filter works perfectly.1 -
Link to AMP VS AMP Google Cache VS Standard page?
Hi guys, During the link building strategy, which version should i prefer as a destination between: to the normal version (php page) to the Amp page of the Website to the Amp page of Google Cache The main doubt is between AMP of the website or standard Version. Does the canonical meta equals the situation or there is a better solution? Thank you so mutch!
Technical SEO | | Dante_Alighieri0 -
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 -
Why does my Google Web Cache Redirects to My Homepage?
Why does my Google Webcache appears in a short period of time and then automatically redirects to my homepage? Is there something wrong with my robots.txt? The only files that I have blocked is below: User-agent: * Disallow: /bin/ Disallow: /common/ Disallow: /css/ Disallow: /download/ Disallow: /images/ Disallow: /medias/ Disallow: /ClientInfo.aspx Disallow: /*affiliateId* Disallow: /*referral*
Technical SEO | | Francis.Magos0 -
Cached version of website
Hi, Upon checking the text cache view of our home page, I noticed the mobile menu links are also coming in text format which looks weird. Please see: http://webcache.googleusercontent.com/search?q=cache:indialetsplay.com&biw=1366&bih=638&noj=1&strip=1 Our coder told us that he has created separate menu i.e. one version for the desktop and one for the mobile version. Anyway, the reason the coder created a different menu for mobile in order to support the design requirements. Does the duplicating the menu good for on page SEO? Give the best solution for handling it.
Technical SEO | | Obbserv0 -
Google dropping pages from SERPs even though indexed and cached. (Shift over to https suspected.)
Anybody know why pages that have previously been indexed - and that are still present in Google's cache - are now not appearing in Google SERPs? All the usual suspects - noindex, robots, duplication filter, 301s - have been ruled out. We shifted our site over from http to https last week and it appears to have started then, although we have also been playing around with our navigation structure a bit too. Here are a few examples... Example 1: Live URL: https://www.normanrecords.com/records/149002-memory-drawings-there-is-no-perfect-place Cached copy: http://webcache.googleusercontent.com/search?q=cache:https://www.normanrecords.com/records/149002-memory-drawings-there-is-no-perfect-place SERP (1): https://www.google.co.uk/search?q=memory+drawings+there+is+no+perfect+place SERP (2): https://www.google.co.uk/search?q=memory+drawings+there+is+no+perfect+place+site%3Awww.normanrecords.com Example 2: SERP: https://www.google.co.uk/search?q=deaf+center+recount+site%3Awww.normanrecords.com Live URL: https://www.normanrecords.com/records/149001-deaf-center-recount- Cached copy: http://webcache.googleusercontent.com/search?q=cache:https://www.normanrecords.com/records/149001-deaf-center-recount- These are pages that have been linked to from our homepage (Moz PA of 68) prominently for days, are present and correct in our sitemap (https://www.normanrecords.com/catalogue_sitemap.xml), have unique content, have decent on-page optimisation, etc. etc. We moved over to https on 11 Aug. There were some initial wobbles (e.g. 301s from normanrecords.com to www.normanrecords.com got caught up in a nasty loop due to the conflicting 301 from http to https) but these were quickly sorted (i.e. spotted and resolved within minutes). There have been some other changes made to the structure of the site (e.g. a reduction in the navigation options) but nothing I know of that would cause pages to drop like this. For the first example (Memory Drawings) we were ranking on the first page right up until this morning and have been receiving Google traffic for it ever since it was added to the site on 4 Aug. Any help very much appreciated! At the very end of my tether / understanding here... Cheers, Nathon
Technical SEO | | nathonraine0 -
Google's "cache:" operator is returning a 404 error.
I'm doing the "cache:" operator on one of my sites and Google is returning a 404 error. I've swapped out the domain with another and it works fine. Has anyone seen this before? I'm wondering if G is crawling the site now? Thx!
Technical SEO | | AZWebWorks0 -
Google cached https rather than http
Google is using a secure version of a page (https) that is meant to be displayed using only http. I don't know of any links to the page using https, but want to verify that. I only have 1 secure page on the site and it does not link to the page in question. What is the easiest way to nail down why Google is using the https version?
Technical SEO | | TheDude0