404 When Assets Has Changed


I’m using the asset feature of yii to publish my css and js files. I looked into the application.log in the runtime directory yesterday, and saw that I often get error messages like “Couldn’t resolve the request: REQUEST_URI=/assets/26283b80/img/myimg.png”. When I check the published asset folder, I see that the directory “26283b80” does not exist anymore, because I changed my css file in the past and so the new directory looks like “45249a20”.

Is that a problem in general? Will the browser of the user that has requested the site and produced this error get the new image? Like: Browser checks -> 404 -> get new image. Or does it display a broken image?

Is there a possibility to avoid this? And is there in general a possibility to tell the browser “my css file has changed, please don’t cache”?

Another example: I named the fields on my contact form page “Contact[email]”, “Contact[message]”. A week ago, I changed the name to “Contactform[email]”, “Contactform[message]” and I changed the corresponding line in my php file to $model->attributes = $_POST[‘Contactform’]; Now I get approx. 3 times per day the error message “Undefined index Contactform”. I think this is because in some browsers the old html with “Contact” gets cached, but the server expects “Contactform”. How can I avoid this?

No ideas? :(

Am I the only yii user with that problem?