When your own image is directly referenced by other websites, which response header decides whether to allow or not.

📅 October 12, 2026 👁️ 18

When your own image is directly referenced by other websites, which response header determines whether to allow it or not? The authority of this header lies with the resource itself, not the site referencing it. Cross-Origin-Resource-Policy is a strategy declared by the resource itself: it tells the browser which sources are allowed to load this resource, and cross-site requests that do not match the declaration are blocked on the client side. Whether to allow or restrict is determined by the response headers of the resources on your own site, and the other site does not need to cooperate.

Who has the authority to declare which resources can be referenced.

A layer of confusion lies in the fact that the page and the resources it can reference belong to two parties. On the side of the initiating page, the isolation header says 'What am I allowed to bring in this context?' and on the side of the resource declaration, it says 'Who can use this thing of mine.' Whether the same cross-site reference can be made depends on the intersection of the declarations on both ends, and any tightening on either end will cause the load to fail. Therefore, when troubleshooting, do not just focus on the error page, but also whether there is a suitable strategy in the response header of the referenced resource, which is another independent clue.

The three values are placed to pass through which layer

Value Pass through which layer Suitable for what type of resource The cost after being released
same-origin (same origin) Only pages from the same origin can be loaded Background attachments, internal preview images The site's own domain changing protocol or port will cause it to be unreadable
same-site (same site) Multiple origins under the same registered domain can be loaded A set of materials shared by the main site and its sub-sites Any sub-site within the same registered domain can refer to it, and the scope of dissemination is no longer controlled
cross-origin (cross origin) Any other origin can be loaded Images and fonts to be distributed externally Others' sites directly consume your bandwidth and access statistics

The issue between the three levels is not a matter of preference between leniency and strictness, but about who is allowed to use the resources. The same file can have different values in different directories, and the granularity is determined by the response.

Which type of requests are blocked by default?

This strategy targets cross-origin or cross-site requests without CORS, that is, requests for images, scripts, and styles that are loaded directly as sub-resources. When the browser reads the tightening statement, it blocks these requests at the client side, while the response of the resource itself is still emitted normally, and the server does not participate in the judgment. This determines its scope of action: it can control whether the browser displays the resources, but cannot prevent someone from directly requesting files by bypassing the browser.

Whether to release images and fonts separately

Images are often referenced from outside, tightening the same origin will immediately make them invisible on other sub-sites of your own, and loosening to cross-origin will consume bandwidth. Fonts often must be loosened to cross-origin because the pages referencing them are originally from other sites, blocking them means the font will fail across the entire site. The choice between the two is usually differentiated by directory: materials that need to be distributed follow a path with a loose declaration, while materials used exclusively on-site are kept tight.

This declaration can't block anything.

The anti-crawling interference code within the site is aimed at how to deal with the content after it is taken away - it acts on the main content, used to reduce the quality of the things obtained in bulk. The resource source strategy is another layer, just dealing with the browser loading step. Treating both as the same thing can easily lead to the judgment bias of 'the pictures are all there, but the text has been taken away by the collection'. If you really want to reduce the consumption of direct citations, you need to go back to the source statement, directory division, and access control.

Common questions

Question: Is it enough to only change the isolation header of the initiating page?Answer: Not enough. The declaration on this side of the referenced resource is independent, both ends must be allowed to load successfully; when the resource side tightens, the page side will not relax even if it is loose.

Question: Will changing the protocol or port affect the same-origin judgment?Answer: Yes. Same-origin looks at the protocol, host, and port, and if any one of them is different, it is not considered the same origin. Such changes often judge the originally normal images as cross-origin.

Question: If it is set to cross-origin, does it mean allowing crawling?Answer: Not equal. This level only determines whether the browser allows a certain source to load this resource, and has no constraint on the direct request for file crawling behavior.

Related articles

Why does the server prefer to return an early status code when it receives a request before the connection is fully established?

The early data of TLS allows the client to send the request in the first round trip, saving the next handshake wait time, at the cost of this type of request being at risk of replay. 425 Too Early indicates that the server is unwilling to take the risk of processing a potentially replayed request and prefers to reject first. This article discusses what the early data saves, where the risk falls on what type of request, why idempotent and non-idempotent need to be treated separately, and what trade-offs a service with Go as the technology stack needs to make at this level.

2026-10-12

When the content does not change, the server only returns a status code, and conditional requests rely on which identifier to judge.

The cache expiration does not mean that you need to download the entire content again. ETag is the identifier of a version of the resource, and a new value must be generated when the resource content changes; the client uses If-None-Match to return the old value during a revisit, and if the server compares it and finds it consistent, it will only return a status code without the body. This article talks about what this identifier represents, the difference between strong verification and weak verification, why the weak identifier can affect segmented requests, and how sites with frequently changing content can use it to reduce duplicate transmission.

2026-10-12

The browser will mark whether the request is from this site or an external site, and how the server can prevent cross-site requests based on this.

The browser adds several Sec-Fetch request headers that indicate the source relationship, which frontend scripts cannot change. The values distinguish between same-origin, same-site, cross-site, and no-origin, and the server decides whether to allow or deny based on these relationships, thereby providing a complementary defense against cross-site request forgery; these headers are only sent in requests from trusted addresses. This article discusses the meanings of the four values, the way to allow based on context, and what they each manage in round-level operation approval.

2026-10-12

After the user logs out, old data still remains in the browser, how to require the response header to be cleared.

When logging out, the cache and local storage left in the browser will not disappear automatically. The Clear-Site-Data response header is a clear signal for the client, which can clear cache, credentials, storage, and execution contexts item by item, and it only takes effect in encrypted connections: credentials are cleared for the entire registration domain, and storage is only cleared for the current source. The login status within the site is carried by JWT, and the local data at this client layer relies on it to complete the cleanup. It is especially worth adding on public devices.

2026-10-12

The server defaults to writing the program version into the response header and error page. Should this level of fingerprint be removed?

Most web servers default to writing the program version into the Server response header and error pages, the Nginx server_tokens directive is set to on by default, after it is turned off, the two places no longer contain version information. Removing this fingerprint can reduce the convenience of version collision, but it only reduces information exposure and does not constitute a defense. This article discusses where the version number leaks out and what remains after it is turned off, as well as where to make changes at each layer for different deployment methods such as Baota and Docker.

2026-10-12

Would adjusting the page layout make it easier for the generative engine to refer to it, and the experiment provides two percentages?

A generative engine optimization study decomposes the content structure into three layers: document architecture, information blocks, and visual emphasis, and conducts experiments on six mainstream generative engines. The report shows a 17.3% increase in citation rate and a 18.5% increase in subjective quality, without changing the main theme content. This article explains what these two percentages refer to, why structural improvement does not equal content quality improvement, and its division of labor with automatic site generation such as llms.txt.

2026-10-12

Is the site description file for the large model meant for humans or for agents, the proposal has changed the statement.

This site description file, according to the current proposal, is to help agents use the website, while the early expression is to help the language model understand the web page, and the service object has expanded from the model to the agent. The file is a plain text list, and only one item is required in the specifications: a first-level title with a project or site name, the rest of the abstract sections, descriptive sections, and file lists grouped by secondary titles are optional. AnQiCMS supports automatic generation of site llms.txt and is different from the site map.

2026-10-12

When the Robots file itself is unreadable, what rules does the crawling party follow?

The original agreement divides the failure to read into two opposite results: when the response status code falls within the five hundred to five hundred and ninety-nine segment of server errors, the crawling party must consider it as completely prohibited; when it falls within the four hundred to four hundred and ninety-nine segment of client errors, the crawling party can access any resource on the server. The agreement also states that these rules are not access authorization and cannot replace content security measures; the background of the station and the user group permissions are the real door.

2026-10-12