Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

HTML Introduction to HTML and CSS HTML: The Structural Foundation of Web Pages and Applications Image Tags

When I refresh I don't get a new picture!?!

I don't get a random new pic in the portfolio.

Henrik Christensen
Henrik Christensen
Python Web Development Techdegree Student 38,322 Points

My best guess is that you might forgot to save the file?

Try paste your code in here, that way it's possible to see what might be causing this problem.

Two things, fist, if you are having issues you need to post the code that you are having difficulty with along with your question, if not no one knows what's going on. Second Did you refresh your browser cache? If using chrome, go to the settings and click more tools then clear browser data, this might help.

You definitely don't need code to understand that this is a browser caching issue. Yes in the future most questions will require code to be posted, but for something like this you absolutely don't.

2 Answers

Hold down Shift and click on refresh button. The browser wont load from cache this way and you will have a new image.

Tati Gvozdik
Tati Gvozdik
746 Points

Thank you, gusf! It works! But even after refreshing my browser cache. Works only your advice. Do you know why?

Tati Gvozdik Each time you hit refresh/press f5 it does what's known as a soft refresh. This will use the cache but revalidate everything during page load, looking for "304 Not Modified" responses. If the browser can avoid re-downloading cached JavaScript files, images, text files, etc. then it will.

Using shift and hitting f5/refresh button does what's called a hard refresh. You're telling the browser Don't use anything in the cache when making the request. Force the browser do re-download every JavaScript file, image, text file, etc

Images, JS files, things like that that get cached that don't tend to change as frequently are cached for 2 reasons. One it conserves bandwidth and 2 it speeds up the display of the web page because you don't have to download 15 javascript files or images.

Callum Anderson
Callum Anderson
8,837 Points

I arrived here with the same question, and SHIFT+F5 solved it for me too. Strange that it wasn't mentioned in the video though - surely Treasure had to hold shift as well?!

Yeah, fail for not mentioning it in the video. <3 you Treasure.