How to leverage browser cache a specific file
-
Hello all,
I am trying to figure out how to add leverage browser caching to these items.- http://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&language=en
- http://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js
- http://www.google-analytics.com/analytics.js
Whats hard is I understand the purpose, but unlike a css file, how do you specify an expiration on an actual direct path file?
Any help or link to get help is appreciated.
Chris
-
Well I guess it's what it is
thank you so much for your insight
-
Unfortunately, you can't specify browser caching for 3rd party content, Chris. Those cache specs would have to implemented by the site the content is actually hosted on.
The only way around this would be to store the 3rd party scripts on your own site and reference them locally. Then they would fall under the caching directives your site had set. This is usually a bad idea though, as it means you'll have no way of knowing when those scripts might have been updated.
This is one of those areas where site speed best practices simply can't be applied to 3rd party content. And if it's just a few such resources it's not going to have much effect on page speed anyway. Where possible, try to load these scripts asynchronously (like analytics.js) or at least place them in the footer of site if you can.
Hope that helps?
Paul
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
-
What tool is best for knowing how many searches are done on a string in a specific country?
I need to know which tool gives me more accurate data, for example in Keyword Explorer, how accurate is the number of searches performed by search engine?
Intermediate & Advanced SEO | | Jorgesep0 -
Google cache from my website give another website
Hello, Some time ago, I already asked a question here because my homepage disappeared from Google for our main keyword. One of the problems that we showing up was the Google cache. If you look to the cache of the website www.conseilfleursdebach.fr, you see that it show the content of www.lesfleursdebach.be. It's both our website, but one is focus on France and the other one on Belgium. http://webcache.googleusercontent.com/search?q=cache%3Awww.conseilfleursdebach.fr&oq=cach&aqs=chrome.0.69i59j69i57j0j69i60j0l2.1374j0j4&sourceid=chrome&ie=UTF-8 Before, there were flags on the page to go to the other country, but in the meantime I removed all links from the .fr to the .be and opposite. This is ongoing since January. Who has an idea of what can cause this and most of all, what do do? Kind regards, Tine
Intermediate & Advanced SEO | | TineDL1 -
Do industry specific domains help SEO?
Hi everyone, I've looked for an answer to this but I can't find one. Hopefully someone can help! I have a new client that is a builder. They currently have a .co.uk domain (e.g. businessname.co.uk) Would it help them if the website was businessname_.builders_ instead? Thanks, Alex
Intermediate & Advanced SEO | | WebsiteAbility0 -
What happens if one remove the disavow file from a non penalised site
What happens if one remove the disavow file from a site that has not received a manual penalty from Google. Although the site did suffer from a drop in traffic and rankings.
Intermediate & Advanced SEO | | Taiger0 -
I've seen and heard alot about city-specific landing pages for businesses with multiple locations, but what about city-specific landing pages for cities nearby that you aren't actually located in? Is it ok to create landing pages for nearby cities?
I asked here https://www.google.com/moderator/#7/e=adbf4 but figured out ask the Moz Community also! Is it actually best practice to create landing pages for nearby cities if you don't have an actual address there? Even if your target customers are there? For example, If I am in Miami, but have a lot of customers who come from nearby cities like Fort Lauderdale is it okay to create those LP's? I've heard this described as best practice, but I'm beginning to question whether Google sees it that way.
Intermediate & Advanced SEO | | RickyShockley2 -
Robot.txt File Not Appearing, but seems to be working?
Hi Mozzers, I am conducting a site audit for a client, and I am confused with what they are doing with their robot.txt file. It shows in GWT that there is a file and it is blocking about 12K URLs (image attached). It also shows in GWT that the file was downloaded 10 hours ago successfully. However, when I go to the robot.txt file link, the page is blank. Would they be doing something advanced to be blocking URLs to hide it it from users? It appears to correctly be blocking log-ins, but I would like to know for sure that it is working correctly. Any advice on this would be most appreciated. Thanks! Jared ihgNxN7
Intermediate & Advanced SEO | | J-Banz0 -
Meta Refresh tag on cache pages- GRRR!
Hi guys, All of our product pages originate in a URL with a unique number but it redirects to an SEO url for the user. These product pages have blocks on the page and these blocks are automatically populated with our database of content. Here's an example of the redirect in place: www.example.com/45643/xxxx.html redirects to www.example.com/seo-friendly-url.html The development team did this for 2 reasons. 1) our internal search needs the unique numbered urls for search and 2) it allows quick redirects as pages are cached. The problem I face is this, the redirects from the cached are being tagged with 'meta refresh', yup, they are 302. The development team said they could stop caching and respond dynamically with a 301 but this would bring in a delay. Speed wise, the cached pages load within 22ms and dynamically 530ms, so yeah half a second more. Currently cached pages just do a meta refresh tagged redirect and I want to move away from this. What would you guys recommend in such a situation? I feel like unless I place a 301, I'll be losing out on rank juice.
Intermediate & Advanced SEO | | Bio-RadAbs0 -
Leveraging a second valuable domain, which has no content currently.
Hello All, Wow, people answer very quickly, concisely and are well informed. Very impressive. I have a question that may be a little different. I have a current site which ranks well, and has lots of links etc etc.. 1. http://www.symbolphot*.com ** * replace the * with an o**. Key search term for this site: "B*ston Wedding Photographer" The second site i own: 2. B*stonWeddingPhotographer.com is currently empty. I can do whatever i want with this site. I was thinking that since my site is mostly images, i could start a duplicate wordpress blog with the same images, but different page text and alt tags to the same images. Obviously, since 'b*ston wedding photographer" is the phrase i want to rank #1 for, how should i go about leveraging the power of the URL? Do you have alternate suggestions beyond duplicating image content? I don't really see a way around that as it's ultimately the images i'm selling to potential clients. And the last part of my question is, how strong are my chances of ranking #1 for "Bston Wedding Photographer" while publishing good content on Bstonweddingphotographer.com ?
Intermediate & Advanced SEO | | symbolphoto0