If I make an AJAX request to a non-PHP file will it count towards the daily hit limit?

If I make an AJAX request to a non-PHP file will it count towards the daily hit limit?

Two things;
The security system may not allow that;

And that yes, anything loading your site will count towards the limit, otherwise people could use AJAX to load in content and not use a single hit

5 Likes

If I link a JS file or an image will that count as a hit? Like: <script src=“script.js”></script> or: <img src=“img.png” />

Yes, as the knowledge page says;

If a visitor loads a single page which has two CSS files, three Javascript files and five images, that will generate a total of 11 hits to load that page. If your website code makes any requests to your website in the background (like with a chat script), these requests count towards your hits usage as well.

(What does the hits limit mean - Docs - InfinityFree Forum) However I am not sure about just using

script src="js.js"

But I think it probably would count aswell

7 Likes

Yes, a web request to any kind of file (or a non-existent file) generates a hit. A static file won’t consume any CPU, RAM or Entry Process usage, but it will still use a hit.

2 Likes

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.