Not a Bug Group image never gets "304 Not modified"

Mtor

New Member
Hi,

While optimizing my customer website speed, I found out that due to the way you call the cover images, they are always loaded by the browser from the server.

Indeed, the browser always load them and the don't get a 304 Not modified if they in fact aren't modified.

I think it's because of that bit of code inside the template :
Code:
<div class="coverImg"><span style="background-image:url({xen:helper teamCover, $team, $team, 0})"></span></div>

The helper returns a base64 image, hence not cached in any manner.

That's a bit annoying if you want to have a medium number of groups per page and still keep the site fast.

Clément
 
Just use the debugger in chrome and you'll see.

Attached a screenshot, the group images are loaded everytime and never cached at all seen from a browser standpoint.
 

Attachments

  • Capture d’écran 2016-02-08 à 22.30.55.webp
    Capture d’écran 2016-02-08 à 22.30.55.webp
    16.3 KB · Views: 67
Just use the debugger in chrome and you'll see.

Attached a screenshot, the group images are loaded everytime and never cached at all seen from a browser standpoint.
MtorIt is as designed. The folder data just store public attachments. Not like xenforo attachment has controller control it, my add-on did not. And many other add-on did same.
 
I don't share that opinion but well, it's your choice.

But at least, it would be better if you had it loaded through a css file to have it 304 not modified instead of having in pure html like that (it's big but I removed lots of chars) :
PHP:
<span style="background-image:url(data:image/jpeg;base64,iVBORw0KGgoAAAANSUhEUgAABgAAAAINCAYAAAD4P7SmAAAgAElEQVR42uzdd5xdZZ044O/UTHqf9EZ6DyRAEkhCSaGKiAgCFgQEWWxrYcWyiqy6awX5YVtk1VURlaVKR1oQSEIgQAghCYEU0nubyczk9weLAkuSc2bunXLmeT4f/zC8986557ztvN+3FHT76I/3BQAAAAAAkCmFbgEAAAAAAGSPAAAAAAAAAGSQAAAAAAAAAGSQAAAAAAAAAGSQAAAAAAAAAGSQAAAAAAAAAGSQAAAAAAAAAGSQAAAAAAAAAGSQAAAAAAAAAGSQAAAAAAAAAGSQAAAAAAAAAGSQAAAAAAAAAGSQAAAAAAAAAGSQAAAAAAAAAGSQAAAAAAAAAGSQAAAAAAAAAGSQAAAAAAAAAGSQAAAAAAAAAGSQAAAAAAAAAGSQAAAAAAAAAGSQAAAAAAAAAGSQAA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AgurTL/SqAQ1Ks/Hv2lXUyXUppBw5fShCk8q7xhqSz9KeN7BMlRYUxfUyy+mL5uq0xPwd5XT9RXwF9o6xIO+h38viBTer3qa9BWdmfAAAAAAAAJEgAAAAAAAECCBAAAAAAAAJAgAQAAAAAAACRIAAAAAAAAAAkSAAAAAAAAQIIEAAAAAAAAkCABAAAAAAAAJEgAAAAAAAAACRIAAAAAAABAggQAAAAAAACQIAEAAAAAAAAkSAAAAAAAAAAJEgAAAAAAAECCBAAAAAAAAJAgAQAAAAAAACRIAAAAAAAAAAkSAAAAAAAAQIL+P7JkD+72rHUsAAAAAElFTkSuQmCC)"></span>
 
All files on my server are scanned against base64 use. I disallow it because its often used for hacking. Each time we were hacked we found base64 in our files.
Why is base64 used?
 
Back
Top