function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
hoomelhoomel 

CSS file not loaded after changing visualforce page

Hello,

 

i just noticed a problem with css files in packages.

I uploaded a css file along with some image files as a .zip package into the static resources.

This css file is correctly loaded and used in a visualforce page i created myself.

 

The problem now is, if i change anything on the visualforce page the css file is never loaded until i upload it again.

There is no difference between changes being made through the online editing tool for this page and changes being uploaded through the force.com IDE software.

 

Is there any known reason for this behaviour?

It is not a problem blocking the further development or customization but it is annoying to always upload the whole package again.

I hope there is any possibility to work around this inconvience.

Best Answer chosen by Admin (Salesforce Developers) 
hoomelhoomel

i was using Firefox 4.0 beta5, but now, the problem seems to be gone. It might have been a problem with the beta, maybe the beta6 update resolved it.

I emptied the cache a couple of times, re-uploaded the zip-package and since my last post everything is working perfectly again.

I even tried with Internet Explorer 8 and everything is fine.

 

Neverthless, thanks for the help!

All Answers

aballardaballard

What do you mean by "the file is never loaded until I upload it again"?  Are you saying the browser cannot find the css file?  How are you referencing it in your page?

 

hoomelhoomel

I built a calendar with several images referenced in the css and set some font and link attributes in the css and those elements which are styled by the css file, are not styled in any way.

The html elements just appear as if they did not have any class assigned to them.

Then, when i upload the .zip file which contains both the css file and the images, every element is correctly styled again.

 

I just noticed, that this behavior stopped after a while. Now, when i edit the page, the styled elements are looking like they should.

 

This is how the css file is referenced in the page:

 

<apex:page sidebar="false" standardStylesheets="false" controller="repeatCon" id="thePage" title="Rental Calendar">
<apex:stylesheet value="{!URLFOR($Resource.calendar, 'CSS.css')}" />

 

 

aballardaballard

Very strange; what browser are you using?  Can you try a different one?  It sounds like somehow your browser is losing the cached copy and failing to get it back.   (Uploading the zip again changes the url generated by Urlfor($Resource....) so the browser won't think it has it cached. 

And "starting to work after a while" sounds like the cached copy timed out...)

 

 

 

 

hoomelhoomel

i was using Firefox 4.0 beta5, but now, the problem seems to be gone. It might have been a problem with the beta, maybe the beta6 update resolved it.

I emptied the cache a couple of times, re-uploaded the zip-package and since my last post everything is working perfectly again.

I even tried with Internet Explorer 8 and everything is fine.

 

Neverthless, thanks for the help!

This was selected as the best answer