0

Hi i need to add aa header expiry in my magento site. below is the script which needs to be add expiry

https://fonts.googleapis.com/css?family=Open+Sans:300,400,700 https://platform.twitter.com/widgets.js https://ssl.google-analytics.com/ga.js

i have a folowing code in my htacess file

<IfModule mod_expires.c>

# Enable expirations
ExpiresActive On

# Default directive
ExpiresDefault "access plus 1 month"

# My favicon
ExpiresByType image/x-icon "access plus 1 year”

# Images
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"

# CSS
ExpiresByType text/css "access 1 month”

# Javascript
ExpiresByType application/javascript "access plus 1 year"

</IfModule>

Please suggest me how can i add expiry for online scripts Thanks

Rohit Goel
  • 3,396
  • 8
  • 56
  • 107
  • You can't. At least not directly. The `Expires*` settings of **your** server got nothing to do with the files delivered by **another** server. You'd need a proxy server between your and the other server to accomplish that. – Jürgen Thelen Mar 24 '14 at 08:21

2 Answers2

0

As of my findings on your question, It is NOT POSSIBLE and it is not recommended also. Go through this How can I add expire headers for scripts that are not on my server?

Community
  • 1
  • 1
Pavan Kumar
  • 1,735
  • 2
  • 28
  • 47
0

You cannot set expiry headers or any headers to files that are served from a third party. Your options are:

  1. Copy those files locally and set your desired headers
  2. Keep it as is and ignore any reports saying headers missing or whatever

Only in rare cases I see advantage in using #1. Otherwise, your best bet is to leave it alone.

Ron
  • 798
  • 4
  • 13