Join us on Discord!
You can help CodeWalrus stay online by donating here.

Dynamically generated GIF scrolltext

Started by DarkestEx, December 20, 2015, 10:14:58 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Dream of Omnimaga

I assume it's because it's dynamically-generated? One other issue could be the file size, though, but in Darkest's case his avatar is under 300 KB.

Btw, try to not make your text too long if you ever use such avatar. Even 300 KB is a bit large for an avatar, especially on 3G, but it's tolerable. But smaller is better whenever possible. I wonder if adding the Walrii would make it larger?
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

c4ooo

Quote from: DJ Omnimaga on December 24, 2015, 07:39:43 AM
I assume it's because it's dynamically-generated? One other issue could be the file size, though, but in Darkest's case his avatar is under 300 KB.
Yes but how does it know that? I would presume the browser just caches every thing except php files.
@DarkestEx

DarkestEx

Quote from: c4ooo on December 25, 2015, 01:07:09 AM
Quote from: DJ Omnimaga on December 24, 2015, 07:39:43 AM
I assume it's because it's dynamically-generated? One other issue could be the file size, though, but in Darkest's case his avatar is under 300 KB.
Yes but how does it know that? I would presume the browser just caches every thing except php files.
@DarkestEx
Well the PHP page generates the image every few hours or when its force refreshed.
The browser has no idea that the image is actually auto generated as the PHP makes it look just like a normal image. PHP files are (as long as the server works correctly) never sent to the actual visitor of the website or their browser. They get executed on the webserver.
  • Calculators owned: TI-84+, Casio 101-S, RPN-Calc, Hewlett-Packard 100LX, Hewlett-Packard 95LX
  • Consoles, mobile devices and vintage computers owned: Original Commodore 64C, C64 DTV, Nintendo GameBoy Color, Nintendo GameCube, Xbox 360, PlayStation 2

c4ooo

sorry if i seem bothersome, but I still dont understand. Why wont the browser just chache the first image that was generated just like it would a static file? Or is the extension of that image literally .php?

Also, i was hoping your profile picture would go into negative numbers, but unfortunately it doesn't XD

DarkestEx

Quote from: c4ooo on January 01, 2016, 06:40:34 AM
sorry if i seem bothersome, but I still dont understand. Why wont the browser just chache the first image that was generated just like it would a static file? Or is the extension of that image literally .php?

Also, i was hoping your profile picture would go into negative numbers, but unfortunately it doesn't XD
Well browsers do cache images on their own, but as many people visit this page, every time my avatar is downloaded by the browser from the internet, it produces a big page load on my side. Every time the image is loaded from the web, the php script I wrote is called. It checks if there is new content or if the image is for any reason outdated. If not, the last generated image is sent. If the image needs to be refreshed, the last image is deleted and a new one is generated and saves to disk.

Haha, I used abs in the first place but after new year I changed it to new, static slogan.
  • Calculators owned: TI-84+, Casio 101-S, RPN-Calc, Hewlett-Packard 100LX, Hewlett-Packard 95LX
  • Consoles, mobile devices and vintage computers owned: Original Commodore 64C, C64 DTV, Nintendo GameBoy Color, Nintendo GameCube, Xbox 360, PlayStation 2

Dream of Omnimaga

I always wondered how to make a php script or image on a web server force refresh every few minute or so or when it changed, because when I change the site logo or edit the theme, it can take months before users see the changes.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

DarkestEx

Quote from: DJ Omnimaga on January 01, 2016, 10:10:44 PM
I always wondered how to make a php script or image on a web server force refresh every few minute or so or when it changed, because when I change the site logo or edit the theme, it can take months before users see the changes.
Doing that is very simple. For CSS, there are a few easy solutions too.
  • Calculators owned: TI-84+, Casio 101-S, RPN-Calc, Hewlett-Packard 100LX, Hewlett-Packard 95LX
  • Consoles, mobile devices and vintage computers owned: Original Commodore 64C, C64 DTV, Nintendo GameBoy Color, Nintendo GameCube, Xbox 360, PlayStation 2

Powered by EzPortal