Reputation: 1227
I had develop a web application (Still not published). It has many performance problem. So I decide cache my static assets into client's browser.
I have two static assets they are app1.js and app2.js (For example).
I would want to cache these assests. So I did add headers for these assest's response that is Cache-Control : max-age=600. Now I had 10 minutes cache of these files. It's working very well.
But one problem is occured. The problem is, If I change my static assets within the 10 minutes my changes not appeard in client. I know my caching process is reason for that. But I want when I change these assets suddenly these changes will update to clients with Cache-Control : max-age=600 header.
At the same time If my changes has occuer only app1.js that only update to client. Not affect the app2.js.
Is there any way to done this? You know detail about caching, please share with me.
Thanks in Advance!
Vasikaran S
Upvotes: 0
Views: 23
Reputation: 601
You could add fragment to the resource request when you update it. So <script src="app1.js">
becomes <script src="app1.js?v=4">
Upvotes: 1