Highlighted

Caching of the CSS

Community Beginner ,
Sep 06, 2018

Copy link to clipboard

Copied

How can I fix the problem that the CSS file gets cached. I make a lot of changes in the CSS file and it would be great if you don't need first to clear the browser cache. Thanks for helping!

Adobe Community Professional
Correct answer by Nancy OShea | Adobe Community Professional

I have Expires Cashing rules in my server's .htaccess file.  In my example below, most file types are cached for 1 year.  CSS for 1 month and the default is 2 days.

## EXPIRES CACHING ##

<IfModule mod_expires.c>

ExpiresActive On

ExpiresByType application/vnd.ms-fontobject "access 1 year"

ExpiresByType application/x-font-ttf "access 1 year"

ExpiresByType application/x-font-opentype "access 1 year"

ExpiresByType application/x-font-woff "access  1 year"

ExpiresByType image/svg+xml "access 1 year"

ExpiresByType image/jpg "access 1 year"

ExpiresByType image/jpeg "access 1 year"

ExpiresByType image/gif "access 1 year"

ExpiresByType image/png "access 1 year"

ExpiresByType text/css "access 1 month"

ExpiresByType application/pdf "access 1 year"

ExpiresByType text/x-javascript "access 1 year"

ExpiresByType text/javascript "access 1 year"

ExpiresByType image/x-icon "access 1 year"

ExpiresDefault "access 2 days"

</IfModule>

## EXPIRES CACHING ##

That siad, the link below describes some cache busting techniques you can try.  Versioning is the simplest.

Strategies for Cache-Busting CSS | CSS-Tricks

Views

211

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Caching of the CSS

Community Beginner ,
Sep 06, 2018

Copy link to clipboard

Copied

How can I fix the problem that the CSS file gets cached. I make a lot of changes in the CSS file and it would be great if you don't need first to clear the browser cache. Thanks for helping!

Adobe Community Professional
Correct answer by Nancy OShea | Adobe Community Professional

I have Expires Cashing rules in my server's .htaccess file.  In my example below, most file types are cached for 1 year.  CSS for 1 month and the default is 2 days.

## EXPIRES CACHING ##

<IfModule mod_expires.c>

ExpiresActive On

ExpiresByType application/vnd.ms-fontobject "access 1 year"

ExpiresByType application/x-font-ttf "access 1 year"

ExpiresByType application/x-font-opentype "access 1 year"

ExpiresByType application/x-font-woff "access  1 year"

ExpiresByType image/svg+xml "access 1 year"

ExpiresByType image/jpg "access 1 year"

ExpiresByType image/jpeg "access 1 year"

ExpiresByType image/gif "access 1 year"

ExpiresByType image/png "access 1 year"

ExpiresByType text/css "access 1 month"

ExpiresByType application/pdf "access 1 year"

ExpiresByType text/x-javascript "access 1 year"

ExpiresByType text/javascript "access 1 year"

ExpiresByType image/x-icon "access 1 year"

ExpiresDefault "access 2 days"

</IfModule>

## EXPIRES CACHING ##

That siad, the link below describes some cache busting techniques you can try.  Versioning is the simplest.

Strategies for Cache-Busting CSS | CSS-Tricks

Views

212

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Sep 06, 2018 0
Mentor ,
Sep 06, 2018

Copy link to clipboard

Copied

Try forcing a hard reload by simultaneously pressing your CTRL and F5 keys.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 06, 2018 0
Community Beginner ,
Sep 06, 2018

Copy link to clipboard

Copied

That works fine for me but for everybody else visiting my website not...

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 06, 2018 0
Mentor ,
Sep 06, 2018

Copy link to clipboard

Copied

I would recommend letting the process unfold naturally. You might get other opinions, but now you have mine

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 06, 2018 0
Adobe Community Professional ,
Sep 06, 2018

Copy link to clipboard

Copied

I have Expires Cashing rules in my server's .htaccess file.  In my example below, most file types are cached for 1 year.  CSS for 1 month and the default is 2 days.

## EXPIRES CACHING ##

<IfModule mod_expires.c>

ExpiresActive On

ExpiresByType application/vnd.ms-fontobject "access 1 year"

ExpiresByType application/x-font-ttf "access 1 year"

ExpiresByType application/x-font-opentype "access 1 year"

ExpiresByType application/x-font-woff "access  1 year"

ExpiresByType image/svg+xml "access 1 year"

ExpiresByType image/jpg "access 1 year"

ExpiresByType image/jpeg "access 1 year"

ExpiresByType image/gif "access 1 year"

ExpiresByType image/png "access 1 year"

ExpiresByType text/css "access 1 month"

ExpiresByType application/pdf "access 1 year"

ExpiresByType text/x-javascript "access 1 year"

ExpiresByType text/javascript "access 1 year"

ExpiresByType image/x-icon "access 1 year"

ExpiresDefault "access 2 days"

</IfModule>

## EXPIRES CACHING ##

That siad, the link below describes some cache busting techniques you can try.  Versioning is the simplest.

Strategies for Cache-Busting CSS | CSS-Tricks

Nancy O'Shea, ACP
Alt-Web Design & Publishing

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 06, 2018 2