Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

mod_expires and far-future expiration

  • 20-11-2010 02:40PM
    #1
    Registered Users, Registered Users 2 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, Registered Users 2 Posts: 6,651 ✭✭✭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