Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

mod_expires and far-future expiration

Options
  • 20-11-2010 2:40pm
    #1
    Registered Users Posts: 648 ✭✭✭


    hi there,

    im using mod_expires on apache 2 and im trying to add far-future expiration date to a js and css file but im having trouble

    (mod_expires and headers is working as it works for images)

    the link to the js file is for example :

    min/g=jsmain&t=idrive&debug=1

    thing is it does not have .js becuase im using a php minify script to include all my js files and minify them.
    so basicallt there is a htaccess in min with the following :
    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule ^([a-z]=.*)  index.php?$1  [L,NE]
    </IfModule>
    

    i tried this also :
    min/g=jsmain&t=idrive&debug=1&contentType=1290177889-expires.js
    (ie adding a .js at the end to see would apache recognise it as a js file)

    but no good whenever i check in YSlow there is no expires date on either my js or css file

    Tnx


Comments

  • Registered Users Posts: 6,494 ✭✭✭daymobrew


    I don't know mod_expires.
    I wonder if it is the parameters to the min script that is causing mod_expires not to add an expires date.

    Can you try it without any parameters and set the data (g, t, debug, contentType within the script). If this works maybe you could change mod_rewrite to convert:
    min-g_jsmain-t_idrive-debug_1-contentType_1290177889-expires.js
    to:
    min/g=jsmain&t=idrive&debug=1&contentType=1290177889-expires.js
    Maybe:
    RewriteRule ^min-g_([a-z]*)-t_([a-z]*)-debug_([0-9]*)-contentType_([a-z]*)-expires.js min/g=$1&t=$2&debug=$3&contentType=$4 [L,NE]


Advertisement