Malarivtan
Malarivtan

Reputation: 414

Leverage browser caching is not working at all

I have the following code in my .htaccess:

<IfModule mod_expires.c>
  ExpiresActive On
  <FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
    ExpiresDefault "access plus 7 days"
  </FilesMatch>
</IfModule>

<IfModule mod_rewrite.c>
    RewriteEngine on

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d

    RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>


<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
    Options -MultiViews
    </IfModule>

RewriteEngine On

# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]

# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>

When I do inspect element in Google chrome: The js and css are NOT loading from chach instead they are loading fresh every time.

please help anyone?

Upvotes: 0

Views: 96

Answers (1)

Taras
Taras

Reputation: 582

Check if your expires module is enabled:

# apachectl -M |grep 'expires'
expires_module (shared)
Syntax OK
#

Upvotes: 1

Related Questions