magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.58k stars 9.32k forks source link

Robots.txt file is cached by Full Page Cache of Magento #39416

Open dandrikop opened 1 day ago

dandrikop commented 1 day ago

Preconditions and environment

When you change the contents of the robots.txt file via Content > Design > Configuration > Search Engine Robots, the changes do not become immediately available on the front-end of the Magento website even if you refresh the Configuration cache via System > Cache Management. It seems that the page https://www.example.com/robots.txt is cached by the Full Page Cache of Magento. I tested that on Magemto 2.4.6-p7 by using REDIS as the Full Page Cache of Magento.

Steps to reproduce

  1. Visit the robots.txt file via the link: https://www.example.com/robots.txt
  2. Change the content of the robots.txt file via Content > Design > Configuration > Search Engine Robots
  3. Refresh the Configuration cache via System > Cache Management
  4. Visit again the robots.txt file via the link: https://www.example.com/robots.txt

Expected result

The new content of the robots.txt file should be viewed at https://www.example.com/robots.txt

Actual result

The old content of the robots.txt file is viewed at "https://www.example.com/robots.txt".

Additional information

The only way to make the changes of the robots.txt available at the front-end of the Magento website is by flushing the Full Page Cache. However, this work-around is not appropriate for the following reasons:

  1. Robots.txt is considered configuration, and so any configuration change should become available immediately.
  2. The Full Page Cache significantly improves the performance of the Magento front-end.
  3. The Full Page Cache may need several days to be filled again even by using intensive Cache warmers.

So, it's worth flushing the Full Page Cache only when there are applied changes affecting a large number of pages, such as the installation of a new module, or the update of existing module.

Release note

No response

Triage and priority

m2-assistant[bot] commented 1 day ago

Hi @dandrikop. Thank you for your report. To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce.

m2-assistant[bot] commented 1 day ago

Hi @engcom-Bravo. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

engcom-Bravo commented 18 hours ago

Hi @dandrikop,

Thanks for your reporting and collaboration.

We have verified the issue in Latest 2.4-develop instance and the issue is not reproducible.Kindly refer the screenshots.

Screenshot 2024-12-02 at 14 01 49

The new content of the robots.txt file viewed at https://www.example.com/robots.txt

Kindly recheck the issue in Latest 2.4-develop instance and elaborate the steps to reproduce and please let us know if we are missing anything.

Thanks.