Pages:
Author

Topic: [ANN] bitcoindata.science | sponsored by BC.Game (Read 4111 times)

legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
The headers in your .htaccess file should be sufficient, but the problem is that Apache isn't actually doing what you wrote there. In eg. Firefox, go to the Network tab of Developer Tools, visit your image, and look at the response headers; Cache-Control, Pragma, and Expires are not sent.
~
or the ifModule test fails
Thanks, it looks like I missed needed this:
Code:
a2enmod headers
systemctl restart apache2
apachectl -M | headers
Now my Response Headers look like this:
Code:
Cache-Control max-age=0, no-cache, no-store, must-revalidate
Expires Wed, 11 Jan 1984 05:00:00 GMT
Pragma no-cache
legendary
Activity: 1890
Merit: 5204
**In BTC since 2013**
Try changing these lines to:
Code:
Header set Cache-Control "max-age=60, must-revalidate"
Header set Expires "access plus 1 minute"


Regarding theymos observation about Apache, try checking if the mod_headers module is available.
administrator
Activity: 5222
Merit: 13032
How do I add "no caching" headers to images?

The headers in your .htaccess file should be sufficient, but the problem is that Apache isn't actually doing what you wrote there. In eg. Firefox, go to the Network tab of Developer Tools, visit your image, and look at the response headers; Cache-Control, Pragma, and Expires are not sent. I haven't used Apache in over a decade, but I would guess that either your Apache is configured to ignore .htaccess files entirely (which is generally recommended in production environments), or the ifModule test fails.
legendary
Activity: 3542
Merit: 3625
Crypto Swap Exchange
This isn't enough:
I've added this to my .htaccess (source):
Code:

  FileETag None
  
     Header unset ETag
     Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
     Header set Pragma "no-cache"
     Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"
  

How do I add "no caching" headers to images?
I find this missed line, seems like a solution (here)
Code:
Header unset Last-Modified
Prevents browsers from revalidating content based on the Last-Modified header
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
I'll post this here, since there seem to be knowledgeable people here Smiley

There was a problem with caching my images, which means they didn't update often enough on the forum. I posted Image proxy caching problem in Meta.

Theymos fixed it:
Since that DDoS a while ago, the imageproxy is now going through Cloudflare, which will do server-side caching if allowed by the final origin's headers, and client Cache-Control headers are (I think) always ignored now. (I haven't decided yet whether having the imageproxy behind Cloudflare is permanent.)

That pricing image doesn't send any cache-related headers at all, aside from Last-Modified. If that .htaccess file is intended for that image, then it's not working. One major issue in this case is that:
 1. The image doesn't send an Expires header.
 2. If an image doesn't have an Expires header, then the imageproxy sets an Expires 1 day into the future. *
 3. Cloudflare then server-side-caches this for 1 day based on the Expires header, and there's no way for the client to bypass Cloudflare's cache.

* I just now changed the default Expires timeout to 10 minutes instead of 1 day, at least as long as the imageproxy is behind Cloudflare. But for live content like this, it'd be better if the origin sent headers disabling caching entirely.
I don't know how to make Apache2 do the bold part. This isn't enough:
I've added this to my .htaccess (source):
Code:

  FileETag None
  
     Header unset ETag
     Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
     Header set Pragma "no-cache"
     Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"
  

How do I add "no caching" headers to images?
legendary
Activity: 2352
Merit: 6089
bitcoindata.science
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
Just to confirm, the fiat values get updated once every hour, right?
Yes:
It'll update hourly, at 20 minutes past the hour.
Judging by the image times, it takes 1-2 minutes to update everything.
legendary
Activity: 2730
Merit: 7065
Now let's test this:
...
I'd say it works, and very fast Smiley
Seems great, thanks a lot LoyceV. I will soon update the images in my thread to see how they will perform in that live environment. I don't expect that any issues will arise. Just to confirm, the fiat values get updated once every hour, right? 

@bitmover
Thanks for your help and for assisting LoyceV in getting this up and working.
legendary
Activity: 1890
Merit: 5204
**In BTC since 2013**
What does "Proxied" do in Cloudflare? I currently can't access the URL, while the IP shows Apache's default page. I think you should turn that off.

"Proxied" makes this address pass through the Cloudflare server to reach the website visitor. If you disable this, this address goes directly to the visitor without going through Cloudflare's servers. Basically, disabling this is the same as not having Cloudflare.

Maybe in this case, this is not necessary.


EDIT:
I posted it, and didn't even realize the conversation had continued. Sorry.


LoyceV really seems like the result was very positive.
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
But I still see server down status in this page.
https://proxyimages.bitcoindata.science/Pmalek
Remove the "s" from http:
http://proxyimages.bitcoindata.science/Pmalek/

Now let's test this:


I'd say it works, and very fast Smiley
legendary
Activity: 2352
Merit: 6089
bitcoindata.science
I think everything is ready on my end. It'll update hourly, at 20 minutes past the hour.
Image directory: proxyimages.bitcoindata.science/Pmalek.
It's not working yet, but I expect it to work once Cloudflare stops trying to proxy this link.
@Pmalek: I didn't build in any error checking. If something fails, let me know.

If anyone else wants this proxy-feature, let me know. I can easily add more users.

I removed the proxy in cloudflare settings



But I still see server down status in this page.
https://proxyimages.bitcoindata.science/Pmalek
legendary
Activity: 2730
Merit: 7065
Pmalek, also if you don't have a problem, move the current version of your thread somewhere, archive or something. I want to test it with my hosting to fix this problem so that it can be functional without an additional proxy.
I had a bit of a busy period last time, I didn't have time to devote myself more to this matter.
Sorry I didn't understand why you need me to move my thread to perform your tests. Do you want to post in it but don't want to do it where it is now so the staff won't consider it spam? Feel free to take anything from the OP you might find useful and post it on the achieve board. Can the links that LoyceV posted help you? 
legendary
Activity: 3542
Merit: 3625
Crypto Swap Exchange
How's this for testing?
...
(Those are all the image links Pmalek sent me, without the rest of his topic)
I can't risk a ban for plagiarism  Roll Eyes
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
Pmalek, also if you don't have a problem, move the current version of your thread somewhere, archive or something. I want to test it with my hosting to fix this problem
How's this for testing?

(Those are all the image links Pmalek sent me, without the rest of his topic)
legendary
Activity: 3542
Merit: 3625
Crypto Swap Exchange
@Pmalek: I didn't build in any error checking. If something fails, let me know.

Pmalek, also if you don't have a problem, move the current version of your thread somewhere, archive or something. I want to test it with my hosting to fix this problem so that it can be functional without an additional proxy.
I had a bit of a busy period last time, I didn't have time to devote myself more to this matter.
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
I think everything is ready on my end. It'll update hourly, at 20 minutes past the hour.
Image directory: proxyimages.bitcoindata.science/Pmalek.
It's not working yet, but I expect it to work once Cloudflare stops trying to proxy this link.
@Pmalek: I didn't build in any error checking. If something fails, let me know.

If anyone else wants this proxy-feature, let me know. I can easily add more users.
legendary
Activity: 3542
Merit: 3625
Crypto Swap Exchange
What does "Proxied" do in Cloudflare? I currently can't access the URL, while the IP shows Apache's default page. I think you should turn that off.
Probably "proxied" should be turned off in this case. it includes cloudflare protection and caching, currently, it's just an unnecessary extra loop.

LoyceV, you should create a virtual host and folder on your side.
something like (for Apache)
Code:

    ServerName proxyimages.bitcoindata.science
    DocumentRoot /var/www/proxyimages

also, don't forget to restart Apache to accept the change

edit: add any file in that folder, so you can test it.
hero member
Activity: 1659
Merit: 687
LoyceV on the road. Or couch.
What does "Proxied" do in Cloudflare? I currently can't access the URL, while the IP shows Apache's default page. I think you should turn that off.
legendary
Activity: 2352
Merit: 6089
bitcoindata.science
But i never created a sub domain,  i dont know how. I use name silo for the registrar. Are the subdomain configuration there?
I don't use Namesilo, but I assume you have some DNS management there. Namecheap gives me a Dashboard, where I can Manage the Advanced DNS under Domain List. Then just add an A Record with to IP: 38.102.86.40.
bitmover you use Cloudflare, so all DNS settings are done there.

In this case something like:
Code:
Type: A
Name: loyce.bitcoindata.science
Content: 38.102.86.40


Thank you examplens, this saved me a lot of time



@LoyceV You can now access it in proxyimages.bitcoindata.science

and soon, pmalek will have his links! You will probably use something like proxyimages.bitcoindata.science/0.000906BTCinUSD.gif for each image.


I copied Pmalek's thread on altcoinstalks forum test, img loading unfortunately, the test area is only visible to registered users.
Only a few images are not loading properly, but the process itself seems to take a bit longer than Btt. I assume it's because of the server speed.

Recreating that topic is an amazing idea examplens. Curiously, it is working almost perfectly in altcoinstalks. But Pmalek has no account there.
legendary
Activity: 3542
Merit: 3625
Crypto Swap Exchange
So, in addition to adding DNS to Cloudflare, you have to configure the subdomain on the server.
Nope, this will be running on my server, on my IP. For what it's worth: I just access it through SSH and edit some config files with vi.
That's right. In this case, the subdomain goes to an external server (external IP by Loyce), so additional settings on the local server would not mean anything.


I copied Pmalek's thread on altcoinstalks forum test, img loading unfortunately, the test area is only visible to registered users.
Only a few images are not loading properly, but the process itself seems to take a bit longer than Btt. I assume it's because of the server speed.
Pages:
Jump to: