teleren/devto huggingface dataset:
The Vary HTTP header
Tags: rest, coding, programming, http
Published: 2024-05-09 09:02:00

I try to constantly deepen my knowledge of HTTP and REST. Recently, I stumbled upon the list of all [registered HTTP Headers](https://www.iana.org/assignments/http-fields/http-fields.xhtml). This post is dedicated to the `Vary` HTTP Header.

## The problem

Two years ago, I wrote about [web resource caching server-side](https://blog.frankel.ch/web-caching/server/). The idea is to set up a component between the client and the upstream to cache previously computed results to avoid overloading the latter. Depending on your infrastructure and requirements, this component can be a reverse proxy or an API Gateway. HTTP offers the [Cache-Control](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control) header to customize the different aspects of caching, _e.g._, the time the server holds the resource in cache before it considers it stale. I used plugin configuration in the above post, but you can also delegate to `Cache-Control`.

Now, imagine the following scenario. You request a resource, _e.g._, `GET /book/1` and get the result:

```http
HTTP/1.1 200 OK
Content-Type: application/json

{
  "id": 1,
  "title": "Notre-Dame de Paris"
}
```

The request succeeds; the result is cached. Now, I request the same resource, but because my code works around XML, I set the `Accept` header to `application/xml`. Unfortunately, the server returns the cached JSON resource, which differs from what I asked and probably utterly breaks my code.

The problem is that the cache key has a single dimension, the URL, by default.

## The solution

We need a configurable multi-dimension cache key. As you can probably guess by now, that's the role of the `Vary` header: it explicitly lists all dimensions of the cache key. In the example above, the upstream would communicate the additional cache key with the following:

```http
HTTP/1.1 200 OK
Content-Type: application/json
Content-Language: en
Vary: Accept


{
  "id": 1,
  "title": "Notre-Dame de Paris"
}
```

Instead of a single cache entry per URL, we now have one per MIME type/URL combination. Note that it's up to the caching component to use this information.

Another common request header is `Accept-Encoding`, which usually specifies which compression algorithms the client can accept. Encoding is another possible cache key. The specification allows specifying multiple cache keys:

```http
HTTP/1.1 200 OK
Content-Type: application/json
Content-Language: en
Vary: Accept, Accept-Encoding


{
  "id": 1,
  "title": "Notre-Dame de Paris"
}
```

## Conclusion

I've described the `Vary`response header in this post. As soon as you configure caching, you must consider possible cache keys and use the `Vary` header accordingly.

**To go further:**

* [RFC 9110: Vary](https://datatracker.ietf.org/doc/html/rfc9110#field.vary)

<hr>

_Originally published at [A Java Geek](https://blog.frankel.ch/vary-http-header) on May 5<sup>th</sup>, 2024_
Zonatoto Slot Online Terbaik Dan Terpercaya 2024
Tags: zonatotologin, togelpulsa5000, togelpulsa, slotpulsa
Published: 2024-05-09 09:00:08

[ZONATOTO : Situs Slot Gampang Menang Hari Ini](https://linkzonatoto.com/)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7slp8tv26ie4jxp25bay.png)
Apakah kamu suka dengan permainan slot online? Jika demikian maka kamu sudah menuju situs slot gacor yang tepat! Di ZONATOTO, kami merupakan salah satu pengembang situs slot yang memiliki afiliasi dengan semua provider tergacor, dan juga kami merupakan salah satu pemegang lisensi dari pengembang game terbaik di Indonesia. Hanya dengan klik tab pada menu slot kami, Kamu akan menemukan lebih dari 30 provider games slot gacor favorit seperti Pragmatic Play, PG SOFT, HABANERO, IDN PLAY, dan masih banyak yang lainnya.

[ZONATOTO](https://linkzonatoto.com/) merupakan agen slot resmi yang memiliki visi dan misi selalu memberikan layanan permainan yang terbaik. Jadi para pengguna kami merupakan prioritas utama. Di sini pemain akan mendapatkan pilihan game yang beragam yang sangat menarik untuk diakses. ZONATOTO telah menyediakan beragam layanan yang maksimal dan juga permainan slot gacor dengan server luar negeri terbaik secara online. Dengan melakukan deposit yang sangat murah yaitu 10.000 tentu membuat anda bisa terhubung dengan segala jenis permainan yang menyenangkan. Sehingga dengan menggunakan modal kecil semua kalangan bisa mengakses berbagai permainannya. Buat Anda yang tidak ingin melewatkan kesempatan terbaik ini segera daftarkan secara gratis hanya di situs slot online ZONATOTO. Mainkan segala permainan menariknya sekarang juga dengan mudah.
Zonatoto Slot Online Terbaik Dan Terpercaya 2024
Tags: zonatotologin, togelpulsa5000, togelpulsa, slotpulsa
Published: 2024-05-09 08:58:24

[ZONATOTO : Situs Slot Gampang Menang Hari Ini](https://hypertogel.com/)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8ecysqyx80qy86ndkedm.png)
Apakah kamu suka dengan permainan slot online? Jika demikian maka kamu sudah menuju situs slot gacor yang tepat! Di ZONATOTO, kami merupakan salah satu pengembang situs slot yang memiliki afiliasi dengan semua provider tergacor, dan juga kami merupakan salah satu pemegang lisensi dari pengembang game terbaik di Indonesia. Hanya dengan klik tab pada menu slot kami, Kamu akan menemukan lebih dari 30 provider games slot gacor favorit seperti Pragmatic Play, PG SOFT, HABANERO, IDN PLAY, dan masih banyak yang lainnya.

[ZONATOTO](https://hypertogel.com/) merupakan agen slot resmi yang memiliki visi dan misi selalu memberikan layanan permainan yang terbaik. Jadi para pengguna kami merupakan prioritas utama. Di sini pemain akan mendapatkan pilihan game yang beragam yang sangat menarik untuk diakses. ZONATOTO telah menyediakan beragam layanan yang maksimal dan juga permainan slot gacor dengan server luar negeri terbaik secara online. Dengan melakukan deposit yang sangat murah yaitu 10.000 tentu membuat anda bisa terhubung dengan segala jenis permainan yang menyenangkan. Sehingga dengan menggunakan modal kecil semua kalangan bisa mengakses berbagai permainannya. Buat Anda yang tidak ingin melewatkan kesempatan terbaik ini segera daftarkan secara gratis hanya di situs slot online ZONATOTO. Mainkan segala permainan menariknya sekarang juga dengan mudah.
Frasi Ti Penso Espressioni Uniche per Condividere i Tuoi Pensieri
Published: 2024-05-09 08:57:21

Se c'è una cosa che può scaldare il cuore e sollevare lo spirito, è sentirsi amati e pensati. In un mondo così frenetico e spesso caotico, le parole possono diventare un balsamo per l'anima, soprattutto quando sono cariche di significato e affetto. Ed è qui che entrano in gioco le "**[Frasi Ti Penso](https://www.frasiit.com/frasi-ti-penso)**".

Che Cosa Significa "Frasi Ti Penso"?

"Ti penso" in italiano significa "penso a te". È una dichiarazione di affetto e attenzione verso qualcuno. Quando accompagnata da frasi significative e profonde, diventa un modo per esprimere sentimenti di amore, amicizia, gratitudine o conforto.

Frasi Ti Penso: Un Modo per Esprimere il Tuo Affetto

Le "Frasi Ti Penso" sono più di semplici parole; sono il veicolo attraverso il quale trasmettere emozioni e connettersi con gli altri in modo autentico e profondo. Che tu stia pensando a un amico lontano, a un familiare bisognoso di conforto o al tuo partner, una frase significativa può fare la differenza nel loro giorno.

Ecco alcune idee per esprimere i tuoi pensieri attraverso le "Frasi Ti Penso":

Per un Amico: "Anche se siamo distanti, tu sei sempre nei miei pensieri. La nostra amicizia è un legame che nulla può spezzare."
Per un Familiare: "In ogni momento di difficoltà, ricorda che la tua forza è la mia ispirazione. Ti penso e ti sostengo sempre."
Per il Tuo Partner: "Ogni giorno che passa, il mio amore per te cresce sempre di più. Ti penso costantemente e non vedo l'ora di essere di nuovo tra le tue braccia."
Per un Momento di Gratitudine: "Grazie per essere la luce nella mia vita. Anche nei momenti bui, il tuo ricordo mi conforta. Ti penso con tutto il mio cuore."
Conclusione

Le "Frasi Ti Penso" sono un tesoro linguistico che può arricchire le relazioni e rendere i legami ancora più saldi. Che tu le usi per esprimere amore, amicizia o gratitudine, assicurati sempre che le tue parole siano sincere e autentiche. In un mondo che spesso dimentica di fermarsi e riflettere, queste piccole espressioni possono fare la differenza. Per ulteriori ispirazioni su frasi significative e altre forme di espressione linguistica, visita **[frasilt.com](https://www.frasiit.com)**.
5 Games that will make you a CSS Expert in 5 days.
Tags: beginners, tutorial, css, webdev
Published: 2024-05-09 08:53:24

I must admit that I have trouble remembering things. Especially when it comes to CSS. CSS Grid and Flexbox for example.

As it turned out, there are quite a lot of games out there, helping to teach CSS. I have listed down the 5 best FREE games that will make you a CSS Expert in 5 days!

1. [Flexbox Defence](http://www.flexboxdefense.com/)
2. [Flexbox Froggy](https://flexboxfroggy.com/)
3. [CSS Garden](https://cssgridgarden.com/)
4. [CSS Dinner](http://flukeout.github.io/)
5. [CSS Battle](https://cssbattle.dev/)

So, Learn CSS while having fun 😊 🎉🔥🥳
FINQ's weekly market insights: Peaks and valleys in the S&P 500 - May 9, 2024
Tags: ai, stockmarket, stock, sp500
Published: 2024-05-09 08:50:44

Dive into this week's highs and lows in the S&P 500, powered by FINQ's advanced AI insights.

**Top achievers:**
- **Amazon (AMZN)** retains its lead with strong scores.
- **Global Payments Inc (GPN)** rises to second with remarkable improvements in both crowd and professional wisdom.
- **Salesforce (CRM)** maintains its position in third, demonstrating consistent performance.

**Facing challenges:**
- **Loews Corp (L)** continues as the least favored.
- **Broadridge Financial Solutions Inc (BR)** worsens to second from bottom, primarily due to a drop in professional wisdom.
- **Viatris Inc (VTRS)** re-enters the bottom three, struggling to keep up with its peers.

Explore the dynamics and understand the shifts with our detailed analysis and forecasts.

**Disclaimer:** This information is for educational purposes only and is not financial advice. Always consider your financial goals and risk tolerance before investing.
ESP32 WiFiManager MQTT Spiffs config ArduinoJson 7
Tags: esp32, cpp
Published: 2024-05-09 08:45:33

```
#include <WiFi.h>
#include <WiFiManager.h>
#include <ArduinoJson.h>
#include <PubSubClient.h>
#include <SPIFFS.h>

// ตั้งค่า WiFiManager
WiFiManager wm;

// ตั้งค่า MQTT
WiFiClient espClient;
PubSubClient client(espClient);

// ตั้งค่า JSON document
StaticJsonDocument<200> doc;

void setup() {
  Serial.begin(115200);

  // เริ่มต้น SPIFFS
  if (!SPIFFS.begin(true)) {
    Serial.println("An Error has occurred while mounting SPIFFS");
    return;
  }

  // รีเซ็ตการตั้งค่า WiFi เมื่อกดปุ่มรีเซ็ตนาน 3 วินาที
  wm.resetSettings();

  // กำหนดค่าเริ่มต้นสำหรับการกำหนดค่าผ่าน WiFiManager
  WiFiManagerParameter custom_mqtt_server("server", "MQTT Server", "mqtt.example.com", 40);
  WiFiManagerParameter custom_mqtt_port("port", "MQTT Port", "1883", 6);
  wm.addParameter(&custom_mqtt_server);
  wm.addParameter(&custom_mqtt_port);

  bool res = wm.autoConnect("ESP32-AP");

  if (!res) {
    Serial.println("Failed to connect");
    // ไม่สามารถเชื่อมต่อ WiFi ให้เข้าสู่โหมด Deep Sleep
  } else {
    Serial.println("Connected to WiFi");

    // เก็บค่า MQTT Server และ Port ลงใน JSON document
    doc["mqtt_server"] = custom_mqtt_server.getValue();
    doc["mqtt_port"] = custom_mqtt_port.getValue();

    // เขียนข้อมูล JSON ลงไฟล์ /data.json ใน SPIFFS
    File file = SPIFFS.open("/data.json", "w");
    if (file) {
      serializeJson(doc, file);
      file.close();
    } else {
      Serial.println("Failed to open /data.json for writing");
    }

    // เชื่อมต่อ MQTT
    client.setServer(doc["mqtt_server"], doc["mqtt_port"].as<int>());
    client.connect("ESP32-Client");
  }
}

void loop() {
  // คงการเชื่อมต่อ MQTT
  client.loop();
}
```
ESP32 WiFiManager MQTT ArduinoJson 7
Tags: esp32, cpp
Published: 2024-05-09 08:40:26

```
#include <WiFi.h>
#include <WiFiManager.h>
#include <ArduinoJson.h>
#include <PubSubClient.h>

// ตั้งค่า WiFiManager
WiFiManager wm;

// ตั้งค่า MQTT
WiFiClient espClient;
PubSubClient client(espClient);
char mqtt_server[40];
char mqtt_port[6];

// ตั้งค่า JSON document
StaticJsonDocument<200> doc;

void setup() {
  Serial.begin(115200);

  // รีเซ็ตการตั้งค่า WiFi เมื่อกดปุ่มรีเซ็ตนาน 3 วินาที
  wm.resetSettings();

  // กำหนดค่าเริ่มต้นสำหรับการกำหนดค่าผ่าน WiFiManager
  WiFiManagerParameter custom_mqtt_server("server", "MQTT Server", "mqtt.example.com", 40);
  WiFiManagerParameter custom_mqtt_port("port", "MQTT Port", "1883", 6);
  wm.addParameter(&custom_mqtt_server);
  wm.addParameter(&custom_mqtt_port);

  bool res = wm.autoConnect("ESP32-AP");

  if (!res) {
    Serial.println("Failed to connect");
    // ไม่สามารถเชื่อมต่อ WiFi ให้เข้าสู่โหมด Deep Sleep
  } else {
    Serial.println("Connected to WiFi");

    // เก็บค่า MQTT Server และ Port จากการกำหนดค่าผ่าน WiFiManager
    strcpy(mqtt_server, custom_mqtt_server.getValue());
    strcpy(mqtt_port, custom_mqtt_port.getValue());

    // เชื่อมต่อ MQTT
    client.setServer(mqtt_server, atoi(mqtt_port));
    client.connect("ESP32-Client");
  }

  // เพิ่มข้อมูลลงใน JSON document
  doc["sensor"] = "BME280";
  doc["data"][0] = 24.5;
  doc["data"][1] = 65.2;

  // สร้าง JSON string จาก JSON document
  String output;
  serializeJson(doc, output);
  Serial.println(output);

  // ส่งข้อมูล JSON ไปยัง MQTT topic
  client.publish("sensors/data", output.c_str());
}

void loop() {
  // คงการเชื่อมต่อ MQTT
  client.loop();
}
```
A small refactor story
Tags: ruby, refactor
Published: 2024-05-09 08:03:33

---
title: A small refactor story
published: true
description: 
tags: Ruby,refactor

# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2024-05-09 07:51 +0000
---

I was working on AREL expression chaining and stumbled on an opportunity to use `reduce/inject`.

This is easy to understand, but verbose, and suffers from treating the first value in a special way:
```rb
combo = expression_proc.call(values.first)

values[1..].each { combo = combo.and(expression_proc.call(_1)) }

combo
```

This starts using `reduce`, but trades clarity for terseness, a downgrade:  
```rb
combo = expression_proc.call(values.first)

values[1..].reduce(combo) do |mem, clause|
  mem.and(expression_proc.call(clause))
end
```

Let's transform all values to expression objects to start.
`reduce` really could be aliased to `chain_with`. :)

```rb
clean_value.map { expression_proc.call(_1) }.reduce(:and)
```
Top Reasons to Hire Software Developers from a Recruitment Agency
Tags: hire, softwaredevelopment, recruitment
Published: 2024-05-09 08:32:27

Are you looking to **[hire software developers from a recruitment agency](https://talentonlease.com/blogs/why-hire-software-developers-through-agency/)**? Read why it's a game-changer! Gain access to a bigger pool of competent and skilled people, ensuring that niche needs are filled accurately. Benefit from hiring flexibility that is tailored to the duration and budget of the project. 

With professional recruiters and large prospect databases, you may drastically speed up the hiring process. Reduce administrative costs and improve HR processes while gaining excellent employee retention support. Broader talent searches reduce the risk of employing the wrong applicant. Choose Talent On Lease for efficient cooperation and dependable IT skills.
𝐓𝐡𝐢𝐬 𝐀𝐏𝐈 𝐢𝐬 𝐚 𝐧𝐢𝐠𝐡𝐭𝐦𝐚𝐫𝐞, 𝐇𝐨𝐰 𝐝𝐢𝐝 𝐭𝐡𝐢𝐬 𝐞𝐯𝐞𝐫 𝐠𝐞𝐭 𝐬𝐡𝐢𝐩𝐩𝐞𝐝?
Tags: webdev, api, documentation
Published: 2024-05-09 08:32:12

"𝐓𝐡𝐢𝐬 𝐀𝐏𝐈 𝐢𝐬 𝐚 𝐧𝐢𝐠𝐡𝐭𝐦𝐚𝐫𝐞, 𝐇𝐨𝐰 𝐝𝐢𝐝 𝐭𝐡𝐢𝐬 𝐞𝐯𝐞𝐫 𝐠𝐞𝐭 𝐬𝐡𝐢𝐩𝐩𝐞𝐝?" - Edy’s reaction while staring at the API documentation.

No one likes this kind of feedback. What should be done so that developers like Edy advocate for the API? Or, what does it take to ship and maintain a robust REST API, one that other developers will love using? 

𝐇𝐞𝐫𝐞 𝐚𝐫𝐞 𝐬𝐨𝐦𝐞 𝐨𝐟 𝐭𝐡𝐞 𝐩𝐨𝐢𝐧𝐭𝐬 𝐚𝐧𝐝 𝐛𝐞𝐬𝐭 𝐩𝐫𝐚𝐜𝐭𝐢𝐜𝐞𝐬 𝐭𝐡𝐚𝐭 𝐈 𝐡𝐚𝐯𝐞 𝐠𝐚𝐭𝐡𝐞𝐫𝐞𝐝 𝐟𝐫𝐨𝐦 𝐭𝐡𝐞 𝐜𝐨𝐦𝐦𝐮𝐧𝐢𝐭𝐲:

1. 𝗦𝘁𝗿𝘂𝗰𝘁𝘂𝗿𝗶𝗻𝗴 𝗮𝗻𝗱 𝗻𝗮𝗺𝗶𝗻𝗴 𝗔𝗣𝗜 𝗲𝗻𝗱𝗽𝗼𝗶𝗻𝘁𝘀: A good API has a well thought out and logical design of endpoints. 🔗

2. 𝗖𝗼𝗺𝗽𝗿𝗲𝗵𝗲𝗻𝘀𝗶𝘃𝗲 𝗗𝗼𝗰𝘂𝗺𝗲𝗻𝘁𝗮𝘁𝗶𝗼𝗻: Bad documentation will throw developers away. A good API makes sure the documentation is clear and follows industry standards. Eg. OpenAI Specifications.🌐

3. 𝗜𝗻𝗽𝘂𝘁 𝗩𝗮𝗹𝗶𝗱𝗮𝘁𝗶𝗼𝐧: A good API meticulously validates user input and provides detailed and structured error messages when an invalid input is received. ❌

4. 𝐑𝐚𝐭𝐞 𝐥𝐢𝐦𝐢𝐭𝐢𝐧𝐠: A good API employs rate limiting to prevent overloading and ensure quality of service for all clients. ⌛

5. 𝐀𝐬𝐲𝐧𝐜𝐡𝐫𝐨𝐧𝐨𝐮𝐬 𝐩𝐫𝐨𝐜𝐞𝐬𝐬𝐢𝐧𝐠: A good API performs longer running tasks in the background using a task queue and worker system and avoids keeping client connections open for extended periods.🔄

6. 𝐌𝐨𝐧𝐢𝐭𝐨𝐫𝐢𝐧𝐠 𝐚𝐧𝐝 𝐨𝐛𝐬𝐞𝐫𝐯𝐚𝐛𝐢𝐥𝐢𝐭𝐲: Maintaining a robust API requires proactive monitoring, so you can take action immediately if there are problems - ideally before they impact consumers. 🔎

𝐄𝐝𝐲 𝐡𝐚𝐭𝐞𝐬 𝐛𝐚𝐝 𝐀𝐏𝐈 𝐝𝐨𝐜𝐮𝐦𝐞𝐧𝐭𝐚𝐭𝐢𝐨𝐧. What are YOUR red flags that can make an API frustrating to work with?
People-to-people bonds are the source of vitality for the development of China-Hungary relations
Published: 2024-05-09 08:28:48


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/70mljr3qxaak55xc7frf.JPG)
China is willing to continuously expand exchanges and cooperation with Hungary in various fields such as education, culture, tourism, sports, youth, media, and local areas, support language teaching in both countries, make full use of the mutually established cultural center platforms, and encourage various personnel and institutions Strengthen exchanges and interactions. China is willing to work with Hungary to continue to improve their respective visa facilitation levels, expand direct flights between the two countries, and create more favorable conditions for personnel exchanges between the two countries.
China and Hungary insist on being good friends who learn from each other
Published: 2024-05-09 08:26:44


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/okjgbvk448qz66h9skkr.jpg)
The Hungarian Cultural Center in Beijing has been operating well for many years, and the Chinese Cultural Center in Budapest is about to be officially put into operation. Many universities in China have opened Hungarian language majors. Confucius Institutes and Confucius Classrooms are very popular in Hungary. The Hungarian-Chinese Bilingual School in Budapest has trained batches of successors to the friendship between China and Hungary. Local exchanges are active and active, with the number of direct passenger flights between the two countries reaching double digits every week, and measures to facilitate personnel exchanges continue to be implemented and bear fruit. People-to-people and cultural exchanges between the two countries have taken greater and greater steps, and the foundation of friendship between the two peoples has become stronger and stronger.
How to create a 3D Button Tailwind CSS
Tags: tailwindcss, css, tutorial, webdef
Published: 2024-05-09 08:20:08

Let's create a 3D button using only Tailwind CSS. A super short tutorial, but it's a great way to learn how to use Tailwind CSS.

[Read the article, See it live and get the code](https://lexingtonthemes.com/tutorials/how-to-create-a-3d-button-with-tailwind-css/)
Taxi service in Noida
Published: 2024-05-09 08:17:55

Noida, a bustling city in India, is home to numerous **[taxi services](https://maps.app.goo.gl/xPJCqCLdBaiA6Juc9)** that cater to the transportation needs of residents and visitors alike. With a plethora of options available, choosing the right taxi service can sometimes be overwhelming. It is essential to consider factors such as reliability, safety, affordability, and convenience when selecting a taxi service in Noida.

One of the key considerations when choosing a taxi service is the reputation of the company. Look for a taxi service with a proven track record of providing safe and reliable transportation services. Reading reviews and testimonials from previous customers can help you gauge the quality of service offered by a particular taxi company.

Another important factor to consider is the fleet of vehicles available. A reputable taxi service in Noida should have a diverse range of vehicles to choose from, ranging from standard sedans to luxury cars. This ensures that customers can select a vehicle that meets their specific needs and preferences.

Additionally, pricing plays a crucial role in selecting a taxi service in noida. While affordability is important, it is essential to strike a balance between cost and quality. Opt for a taxi service that offers transparent pricing with no hidden fees or surcharges.
What are crypto mining taxes?
Tags: cryptocurrency, asic, bitcoin
Published: 2024-05-09 08:12:08

The amount of tax you pay depends on how you received the cryptocurrency, and in some cases, the time period you kept it. Rules differ depending on whether the cryptocurrency was mined or purchased.

Cryptocurrency holdings are viewed more as a form of property than income. When you sell your cryptocurrency holdings, you will generally be taxed on the capital gain you made. Losses are recorded as capital losses. Taxes are levied on short-term gains if the holding has been held for less than one year. Long-term gains are taxed if it's been held for over a year.

Cryptocurrency mining is not regulated the same way. Commercial and hobby miners are both required to declare their mining income. The IRS may submit your Bitcoin or other cryptocurrency earnings from mining work to the payer or mining pools. The miner records the sum as business revenue, even if it is paid in kind rather than cash.

Wash sale rule is coming to the bitcoin market. **[Crypto-taxation ](https://asicmarketplace.com/blog/tax-implications-of-asic-mining/)**regulations are needed as more traders invest their money in digital assets and cryptocurrencies.