0

How can i use the htacess from caching my main.css and main.js file. However i use multiple js files and css files like so

css --- main.css dafault.css new.css

js --- main.js acc.jss new.js

what i want to do is prevent the caching of only main.css and main.js how can i do that but the rest of the css files as well as the js files should be cached

1 Answer 1

1

Make the script & css references versioned. add a date time string at the end of file extension with ? mark. Ex:

<script src = "main.js?ver=" + dateTimeNow />
Sign up to request clarification or add additional context in comments.

1 Comment

I didn't get this thing with a variable to work like you put it above, but I used this concept of putting the version on the end using a ? so that worked for me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.