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
-
Using 2 cache plugin good or not?
Hi, Can anyone tell me - whether using 2 cache plugin helps or it cause any issue? Besides, when i used w3 cache plugin in WordPress its found like inline CSS issue to get cleared. So, i tried auto optimized but my website Soc prollect gone crashed in between while using the some. Is there any solution and can anyone tell me which plugin advantages to speed the site by removing java script and inline css at a time.
Technical SEO | | nazfazy0 -
Bing Webmaster Tools Incompatibility Issues with new Microsoft Edge Browser
Our client received an email from Bing WMTs saying "We have identified 4 known issues with your website in Microsoft Edge – the new default browser for Windows 10 and Bing – Of the four problems mentioned, only two seem to be relevant (maybe) We’ve found that this webpage may include HTML markup that treats Microsoft Edge differently from other modern browsers. The new EdgeHTML rendering engine for Microsoft Edge is document-mode agnostic and designed for fast, modern rendering. We recommend that you implement one code base for all modern browsers and include Microsoft Edge as part of your modern browser test matrix. **We've found that this webpage may have missing vendor-specific prefixes **or may have implemented vendor-specific prefixes when they are not required in common CSS properties. This may cause compatibility problems with how this webpage renders across different browsers. Last month the client received 20K visitors from all IE browsers and this is significant enough to be concerned about. **Are other folks making changes to their code to adapt to MS Edge? **
Technical SEO | | RosemaryB0 -
Can I speed up removal of cache for 301'd page on unverified website?
I recently asked another website to remove a page from their website (I have no control over this website) and they have now 301'd this old URL to another - this is just what I wanted. My only aim now is to see the Google cache removed for that page as quickly as possible.
Technical SEO | | Mark_Reynolds
I'm not sure that asking the website to remove the url via WMT is the right way to go and assume I should just be waiting for Google to pick up the 301 and naturally remove the cache. But are there any recommended methods I can use to speed this process up? The old URL was last cached on 3 Oct 2014 so not too long ago. I don't think the URL is linked from any other page on the Internet now, but I guess it would still be in Google's list of URLs to crawl. Should I sit back and wait (who knows how long that would take?) or would adding a link to the old URL from a website I manage speed things up? Or would it help to submit the old URL to Google's Submission tool? URL0 -
NGINX 301 configuration - it is correct?
I'm totally not an expert in Technical Seo... but i am worry that my server admin neither is. Below is his vhost configuration, anyone can check this? it's this correct and SEO friendly? server { listen *:80; server_name domainaddress.pl domainaddress.com.pl; root /home/www/domainaddress.pl/web; index index.html index.htm key-words.php index.php index.cgi index.pl index.xhtml; location /key {
Technical SEO | | Nemo85
rewrite ^/key-words/$ http://domainaddress.pl/ permanent;
rewrite ^/key-words.php$ http://domainaddress.pl/ break;
} location / {
if ($http_host ~ "^www.domainaddress.pl"){
rewrite ^(.*)$ http://domainaddress.pl/$1 permanent;
} rewrite ^/key-words.php$ http://domainaddress.pl/ permanent;
} }0 -
Pages not being cached have a negative effect?
Hi all! I look after a website where it's been discovered a section of the website has the noarchive robots meta tag active on it causing it to not get cached but has been indexed. Out of curiosity has anyone seen any negative effects from Google for having pages that aren't cached? It's not the strongest section on the website so makes it tricky to judge myself but interested if anyone had any thoughts on the matter. Cheers,
Technical SEO | | thisisOllie0 -
I am wondering if I should use the Meta 'Cache" tag?
I am working on removing unnecessary meta tags that have little impact on SEO and I have read so many mixed reviews about using the Meta 'Cache' tag. I need to informative information on whether or not this tag should be used.
Technical SEO | | ImagetecLP0 -
301 redirect to 1 of 3 locations based on browser languge? Is this ok?
Hi all, I'm taking over a site that has some redirect issues that need addressed and I want to make sure this is done right the first time. The problem: Our current setup starts with us allowing both non-www and www pages. I'll address this with a proper rewrite so all pages will have www. Server info: IIS and runs PHP. The real concern is that we currently run a browser detection for language at the root and then do a 302 redirect to /en, /ge or /fr. There is no page at the www.matchware.com. It's an immediate redirect to a language folder. I'd like to get these to a 301(Permanent) redirect but I'm not sure if a URL can have a 301 redirect that can go to 3 different locations. The site is huge and a site overhaul is not an option anytime soon. Our home page uses this: <%
Technical SEO | | vheilman
lang = Request.ServerVariables("HTTP_ACCEPT_LANGUAGE")
real_lang = Left(lang,2)
'Response.Write real_lang
Select case real_lang
case "en"
Response.Redirect "/en"
case "fr"
Response.Redirect "/fr"
case "de"
Response.Redirect "/ge"
case else
Response.Redirect "/en" End Select
%> Here is a header response test. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ HTTP Request Header Connect to 87.54.60.174 on port 80 ... ok GET / HTTP/1.1[CRLF] Host: www.matchware.com[CRLF] Connection: close[CRLF] User-Agent: Web-sniffer/1.0.37 (+http://web-sniffer.net/)[CRLF] Accept-Charset: ISO-8859-1,UTF-8;q=0.7,*;q=0.7[CRLF] Cache-Control: no-cache[CRLF] Accept-Language: de,en;q=0.7,en-us;q=0.3[CRLF] Referer: http://web-sniffer.net/[CRLF] [CRLF] HTTP Response Header --- --- --- Status: HTTP/1.1 302 Object moved Connection: close Date: Fri, 13 May 2011 14:28:30 GMT Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET Location: /ge Content-Length: 124 Content-Type: text/html Set-Cookie: ASPSESSIONIDQSRBQACT=HABMIHACEMGHEHLLNJPMNGFJ; path=/ Cache-control: private Content (0.12 <acronym title="KibiByte = 1024 Byte">KiB</acronym>) <title></span>Object moved<span class="tag"></title> # Object Moved This object may be found <a< span="">HREF="/ge">here. +++++++++++++++++++++++++++++++++++++++++++++++++++++ To sum it up, I know a 302 is a bad option, but I don't know if a 301 is a real option for us since it can be redirected to 1 of 3 pages? Any suggestions?</a<>1 -
Bing Cache
How can you see what pages are cached by bing. I'm basically looking for these google approaches for bing: cache:domain.com site:domain.com Thanks Tyler
Technical SEO | | tylerfraser1