The Moz Q&A Forum

    • Forum
    • Questions
    • My Q&A
    • Users
    • Ask the Community

    Welcome to the Q&A Forum

    Browse the forum for helpful insights and fresh discussions about all things SEO.

    1. SEO and Digital Marketing Q&A Forum
    2. Categories
    3. Intermediate & Advanced SEO
    4. How to leverage browser cache a specific file

    How to leverage browser cache a specific file

    Intermediate & Advanced SEO
    3 2 8.1k
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as question
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • asbchris
      asbchris last edited by

      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

      1 Reply Last reply Reply Quote 0
      • ThompsonPaul
        ThompsonPaul last edited by

        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

        1 Reply Last reply Reply Quote 2
        • asbchris
          asbchris last edited by

          Well I guess it's what it is

          thank you so much for your insight

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          • Set Robots.txt file to crawl my website at specific times
            Tenlo
            Tenlo
            0
            2
            50

          • Browser Cacheing - HTTPS redirects to HTTP
            0
            1
            59

          • Browser caching for SEO - Hinders updates
            0
            1
            134

          • FIle Names
            WhoWuddaThunk
            WhoWuddaThunk
            0
            2
            45

          • 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?
            AlanMosley
            AlanMosley
            1
            3
            1.9k

          • Template Files .tpl versus .html files
            0
            1
            1.7k

          • Are htm files stronger than aspx files?
            Khem_Raj7
            Khem_Raj7
            0
            6
            705

          • How can I change my website's content on specific pages without affecting ranking for specific keywords?
            RyanKent
            RyanKent
            0
            3
            1.2k

          Get started with Moz Pro!

          Unlock the power of advanced SEO tools and data-driven insights.

          Start my free trial
          Products
          • Moz Pro
          • Moz Local
          • Moz API
          • Moz Data
          • STAT
          • Product Updates
          Moz Solutions
          • SMB Solutions
          • Agency Solutions
          • Enterprise Solutions
          • Digital Marketers
          Free SEO Tools
          • Domain Authority Checker
          • Link Explorer
          • Keyword Explorer
          • Competitive Research
          • Brand Authority Checker
          • Local Citation Checker
          • MozBar Extension
          • MozCast
          Resources
          • Blog
          • SEO Learning Center
          • Help Hub
          • Beginner's Guide to SEO
          • How-to Guides
          • Moz Academy
          • API Docs
          About Moz
          • About
          • Team
          • Careers
          • Contact
          Why Moz
          • Case Studies
          • Testimonials
          Get Involved
          • Become an Affiliate
          • MozCon
          • Webinars
          • Practical Marketer Series
          • MozPod
          Connect with us

          Contact the Help team

          Join our newsletter
          Moz logo
          © 2021 - 2026 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
          • Accessibility
          • Terms of Use
          • Privacy